| /**
|
| * Copyright (c) 2010, 2019 Mia-Software and others.
|
| * All rights reserved. This program and the accompanying materials
|
| * are made available under the terms of the Eclipse Public License v2.0
|
| * which accompanies this distribution, and is available at
|
| * http://www.eclipse.org/legal/epl-v20.html
|
| *
|
| * Contributors:
|
| *
|
| * Nicolas Guyomar (Mia-Software) - initial API and implementation
|
| */ |
| package org.eclipse.modisco.jee.webapp.webapp30.impl;
|
|
|
| import java.lang.String;
|
|
|
| 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.modisco.jee.webapp.webapp30.DocumentRoot;
|
| import org.eclipse.modisco.jee.webapp.webapp30.WebAppType;
|
| import org.eclipse.modisco.jee.webapp.webapp30.Webapp30Package;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * An implementation of the model object '<em><b>Document Root</b></em>'.
|
| * <!-- end-user-doc -->
|
| * <p>
|
| * The following features are implemented:
|
| * <ul>
|
| * <li>{@link org.eclipse.modisco.jee.webapp.webapp30.impl.DocumentRootImpl#getMixed <em>Mixed</em>}</li>
|
| * <li>{@link org.eclipse.modisco.jee.webapp.webapp30.impl.DocumentRootImpl#getXMLNSPrefixMap <em>XMLNS Prefix Map</em>}</li>
|
| * <li>{@link org.eclipse.modisco.jee.webapp.webapp30.impl.DocumentRootImpl#getXSISchemaLocation <em>XSI Schema Location</em>}</li>
|
| * <li>{@link org.eclipse.modisco.jee.webapp.webapp30.impl.DocumentRootImpl#getWebApp <em>Web App</em>}</li>
|
| * </ul>
|
| * </p>
|
| *
|
| * @generated
|
| */
|
| public class DocumentRootImpl extends EObjectImpl implements DocumentRoot {
|
| /**
|
| * 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 DocumentRootImpl() {
|
| super();
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| protected EClass eStaticClass() {
|
| return Webapp30Package.eINSTANCE.getDocumentRoot();
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public FeatureMap getMixed() {
|
| if (mixed == null) {
|
| mixed = new BasicFeatureMap(this, Webapp30Package.DOCUMENT_ROOT__MIXED);
|
| }
|
| return mixed;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public EMap<String, String> getXMLNSPrefixMap() {
|
| if (xMLNSPrefixMap == null) {
|
| xMLNSPrefixMap = new EcoreEMap<String,String>(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, EStringToStringMapEntryImpl.class, this, Webapp30Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP);
|
| }
|
| return xMLNSPrefixMap;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public EMap<String, String> getXSISchemaLocation() {
|
| if (xSISchemaLocation == null) {
|
| xSISchemaLocation = new EcoreEMap<String,String>(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, EStringToStringMapEntryImpl.class, this, Webapp30Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION);
|
| }
|
| return xSISchemaLocation;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public WebAppType getWebApp() {
|
| return (WebAppType)getMixed().get(Webapp30Package.eINSTANCE.getDocumentRoot_WebApp(), true);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public NotificationChain basicSetWebApp(WebAppType newWebApp, NotificationChain msgs) {
|
| return ((FeatureMap.Internal)getMixed()).basicAdd(Webapp30Package.eINSTANCE.getDocumentRoot_WebApp(), newWebApp, msgs);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public void setWebApp(WebAppType newWebApp) {
|
| ((FeatureMap.Internal)getMixed()).set(Webapp30Package.eINSTANCE.getDocumentRoot_WebApp(), newWebApp);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
| switch (featureID) {
|
| case Webapp30Package.DOCUMENT_ROOT__MIXED:
|
| return ((InternalEList<?>)getMixed()).basicRemove(otherEnd, msgs);
|
| case Webapp30Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
|
| return ((InternalEList<?>)getXMLNSPrefixMap()).basicRemove(otherEnd, msgs);
|
| case Webapp30Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
|
| return ((InternalEList<?>)getXSISchemaLocation()).basicRemove(otherEnd, msgs);
|
| case Webapp30Package.DOCUMENT_ROOT__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 Webapp30Package.DOCUMENT_ROOT__MIXED:
|
| if (coreType) return getMixed();
|
| return ((FeatureMap.Internal)getMixed()).getWrapper();
|
| case Webapp30Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
|
| if (coreType) return getXMLNSPrefixMap();
|
| else return getXMLNSPrefixMap().map();
|
| case Webapp30Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
|
| if (coreType) return getXSISchemaLocation();
|
| else return getXSISchemaLocation().map();
|
| case Webapp30Package.DOCUMENT_ROOT__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 Webapp30Package.DOCUMENT_ROOT__MIXED:
|
| ((FeatureMap.Internal)getMixed()).set(newValue);
|
| return;
|
| case Webapp30Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
|
| ((EStructuralFeature.Setting)getXMLNSPrefixMap()).set(newValue);
|
| return;
|
| case Webapp30Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
|
| ((EStructuralFeature.Setting)getXSISchemaLocation()).set(newValue);
|
| return;
|
| case Webapp30Package.DOCUMENT_ROOT__WEB_APP:
|
| setWebApp((WebAppType)newValue);
|
| return;
|
| }
|
| super.eSet(featureID, newValue);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public void eUnset(int featureID) {
|
| switch (featureID) {
|
| case Webapp30Package.DOCUMENT_ROOT__MIXED:
|
| getMixed().clear();
|
| return;
|
| case Webapp30Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
|
| getXMLNSPrefixMap().clear();
|
| return;
|
| case Webapp30Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
|
| getXSISchemaLocation().clear();
|
| return;
|
| case Webapp30Package.DOCUMENT_ROOT__WEB_APP:
|
| setWebApp((WebAppType)null);
|
| return;
|
| }
|
| super.eUnset(featureID);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public boolean eIsSet(int featureID) {
|
| switch (featureID) {
|
| case Webapp30Package.DOCUMENT_ROOT__MIXED:
|
| return mixed != null && !mixed.isEmpty();
|
| case Webapp30Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
|
| return xMLNSPrefixMap != null && !xMLNSPrefixMap.isEmpty();
|
| case Webapp30Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
|
| return xSISchemaLocation != null && !xSISchemaLocation.isEmpty();
|
| case Webapp30Package.DOCUMENT_ROOT__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();
|
| }
|
|
|
| } //DocumentRootImpl
|