| /******************************************************************************* |
| * Copyright (c) 2009 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.jst.javaee.webapp.internal.impl; |
| |
| import java.util.Map; |
| |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.common.util.EMap; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EStructuralFeature; |
| import org.eclipse.emf.ecore.EcorePackage; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.EObjectImpl; |
| import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl; |
| |
| import org.eclipse.emf.ecore.util.BasicFeatureMap; |
| import org.eclipse.emf.ecore.util.EcoreEMap; |
| import org.eclipse.emf.ecore.util.FeatureMap; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.jst.javaee.web.WebApp; |
| |
| import org.eclipse.jst.javaee.webapp.WebAppDeploymentDescriptor; |
| |
| import org.eclipse.jst.javaee.webapp.internal.metadata.WebappPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Web App Deployment Descriptor</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.jst.javaee.webapp.internal.impl.WebAppDeploymentDescriptorImpl#getMixed <em>Mixed</em>}</li> |
| * <li>{@link org.eclipse.jst.javaee.webapp.internal.impl.WebAppDeploymentDescriptorImpl#getXMLNSPrefixMap <em>XMLNS Prefix Map</em>}</li> |
| * <li>{@link org.eclipse.jst.javaee.webapp.internal.impl.WebAppDeploymentDescriptorImpl#getXSISchemaLocation <em>XSI Schema Location</em>}</li> |
| * <li>{@link org.eclipse.jst.javaee.webapp.internal.impl.WebAppDeploymentDescriptorImpl#getWebApp <em>Web App</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class WebAppDeploymentDescriptorImpl extends EObjectImpl implements WebAppDeploymentDescriptor { |
| /** |
| * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMixed() |
| * @generated |
| * @ordered |
| */ |
| protected FeatureMap mixed; |
| |
| /** |
| * The cached value of the '{@link #getXMLNSPrefixMap() <em>XMLNS Prefix Map</em>}' map. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getXMLNSPrefixMap() |
| * @generated |
| * @ordered |
| */ |
| protected EMap<String, String> xMLNSPrefixMap; |
| |
| /** |
| * The cached value of the '{@link #getXSISchemaLocation() <em>XSI Schema Location</em>}' map. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getXSISchemaLocation() |
| * @generated |
| * @ordered |
| */ |
| protected EMap<String, String> xSISchemaLocation; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected WebAppDeploymentDescriptorImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return WebappPackage.Literals.WEB_APP_DEPLOYMENT_DESCRIPTOR; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FeatureMap getMixed() { |
| if (mixed == null) { |
| mixed = new BasicFeatureMap(this, WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__MIXED); |
| } |
| return mixed; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Map<String, String> getXMLNSPrefixMap() { |
| if (xMLNSPrefixMap == null) { |
| xMLNSPrefixMap = new EcoreEMap<String,String>(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, EStringToStringMapEntryImpl.class, this, WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__XMLNS_PREFIX_MAP); |
| } |
| return xMLNSPrefixMap.map(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Map<String, String> getXSISchemaLocation() { |
| if (xSISchemaLocation == null) { |
| xSISchemaLocation = new EcoreEMap<String,String>(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, EStringToStringMapEntryImpl.class, this, WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__XSI_SCHEMA_LOCATION); |
| } |
| return xSISchemaLocation.map(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public WebApp getWebApp() { |
| return (WebApp)getMixed().get(WebappPackage.Literals.WEB_APP_DEPLOYMENT_DESCRIPTOR__WEB_APP, true); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetWebApp(WebApp newWebApp, NotificationChain msgs) { |
| return ((FeatureMap.Internal)getMixed()).basicAdd(WebappPackage.Literals.WEB_APP_DEPLOYMENT_DESCRIPTOR__WEB_APP, newWebApp, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setWebApp(WebApp newWebApp) { |
| ((FeatureMap.Internal)getMixed()).set(WebappPackage.Literals.WEB_APP_DEPLOYMENT_DESCRIPTOR__WEB_APP, newWebApp); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__MIXED: |
| return ((InternalEList<?>)getMixed()).basicRemove(otherEnd, msgs); |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__XMLNS_PREFIX_MAP: |
| return ((InternalEList<?>)((EMap.InternalMapView<String, String>)getXMLNSPrefixMap()).eMap()).basicRemove(otherEnd, msgs); |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__XSI_SCHEMA_LOCATION: |
| return ((InternalEList<?>)((EMap.InternalMapView<String, String>)getXSISchemaLocation()).eMap()).basicRemove(otherEnd, msgs); |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__WEB_APP: |
| return basicSetWebApp(null, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__MIXED: |
| if (coreType) return getMixed(); |
| return ((FeatureMap.Internal)getMixed()).getWrapper(); |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__XMLNS_PREFIX_MAP: |
| if (coreType) return ((EMap.InternalMapView<String, String>)getXMLNSPrefixMap()).eMap(); |
| else return getXMLNSPrefixMap(); |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__XSI_SCHEMA_LOCATION: |
| if (coreType) return ((EMap.InternalMapView<String, String>)getXSISchemaLocation()).eMap(); |
| else return getXSISchemaLocation(); |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__WEB_APP: |
| return getWebApp(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__MIXED: |
| ((FeatureMap.Internal)getMixed()).set(newValue); |
| return; |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__XMLNS_PREFIX_MAP: |
| ((EStructuralFeature.Setting)((EMap.InternalMapView<String, String>)getXMLNSPrefixMap()).eMap()).set(newValue); |
| return; |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__XSI_SCHEMA_LOCATION: |
| ((EStructuralFeature.Setting)((EMap.InternalMapView<String, String>)getXSISchemaLocation()).eMap()).set(newValue); |
| return; |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__WEB_APP: |
| setWebApp((WebApp)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__MIXED: |
| getMixed().clear(); |
| return; |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__XMLNS_PREFIX_MAP: |
| getXMLNSPrefixMap().clear(); |
| return; |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__XSI_SCHEMA_LOCATION: |
| getXSISchemaLocation().clear(); |
| return; |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__WEB_APP: |
| setWebApp((WebApp)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__MIXED: |
| return mixed != null && !mixed.isEmpty(); |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__XMLNS_PREFIX_MAP: |
| return xMLNSPrefixMap != null && !xMLNSPrefixMap.isEmpty(); |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__XSI_SCHEMA_LOCATION: |
| return xSISchemaLocation != null && !xSISchemaLocation.isEmpty(); |
| case WebappPackage.WEB_APP_DEPLOYMENT_DESCRIPTOR__WEB_APP: |
| return getWebApp() != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (mixed: "); //$NON-NLS-1$ |
| result.append(mixed); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //WebAppDeploymentDescriptorImpl |