blob: 3580ee81933d0dff40a58333cd587ee27cf9d08c [file] [log] [blame]
/**
*/
package io.shell.admin.iec61360._2._0.impl;
import io.shell.admin.iec61360._2._0.DocumentRoot;
import io.shell.admin.iec61360._2._0.KeyT;
import io.shell.admin.iec61360._2._0._0Package;
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.EStringToStringMapEntryImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Document Root</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link io.shell.admin.iec61360._2._0.impl.DocumentRootImpl#getMixed <em>Mixed</em>}</li>
* <li>{@link io.shell.admin.iec61360._2._0.impl.DocumentRootImpl#getXMLNSPrefixMap <em>XMLNS Prefix Map</em>}</li>
* <li>{@link io.shell.admin.iec61360._2._0.impl.DocumentRootImpl#getXSISchemaLocation <em>XSI Schema Location</em>}</li>
* <li>{@link io.shell.admin.iec61360._2._0.impl.DocumentRootImpl#getKey <em>Key</em>}</li>
* </ul>
*
* @generated
*/
public class DocumentRootImpl extends MinimalEObjectImpl.Container 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 _0Package.Literals.DOCUMENT_ROOT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FeatureMap getMixed() {
if (mixed == null) {
mixed = new BasicFeatureMap(this, _0Package.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, _0Package.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, _0Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION);
}
return xSISchemaLocation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public KeyT getKey() {
return (KeyT)getMixed().get(_0Package.Literals.DOCUMENT_ROOT__KEY, true);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetKey(KeyT newKey, NotificationChain msgs) {
return ((FeatureMap.Internal)getMixed()).basicAdd(_0Package.Literals.DOCUMENT_ROOT__KEY, newKey, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setKey(KeyT newKey) {
((FeatureMap.Internal)getMixed()).set(_0Package.Literals.DOCUMENT_ROOT__KEY, newKey);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case _0Package.DOCUMENT_ROOT__MIXED:
return ((InternalEList<?>)getMixed()).basicRemove(otherEnd, msgs);
case _0Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
return ((InternalEList<?>)getXMLNSPrefixMap()).basicRemove(otherEnd, msgs);
case _0Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
return ((InternalEList<?>)getXSISchemaLocation()).basicRemove(otherEnd, msgs);
case _0Package.DOCUMENT_ROOT__KEY:
return basicSetKey(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 _0Package.DOCUMENT_ROOT__MIXED:
if (coreType) return getMixed();
return ((FeatureMap.Internal)getMixed()).getWrapper();
case _0Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
if (coreType) return getXMLNSPrefixMap();
else return getXMLNSPrefixMap().map();
case _0Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
if (coreType) return getXSISchemaLocation();
else return getXSISchemaLocation().map();
case _0Package.DOCUMENT_ROOT__KEY:
return getKey();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case _0Package.DOCUMENT_ROOT__MIXED:
((FeatureMap.Internal)getMixed()).set(newValue);
return;
case _0Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
((EStructuralFeature.Setting)getXMLNSPrefixMap()).set(newValue);
return;
case _0Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
((EStructuralFeature.Setting)getXSISchemaLocation()).set(newValue);
return;
case _0Package.DOCUMENT_ROOT__KEY:
setKey((KeyT)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case _0Package.DOCUMENT_ROOT__MIXED:
getMixed().clear();
return;
case _0Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
getXMLNSPrefixMap().clear();
return;
case _0Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
getXSISchemaLocation().clear();
return;
case _0Package.DOCUMENT_ROOT__KEY:
setKey((KeyT)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case _0Package.DOCUMENT_ROOT__MIXED:
return mixed != null && !mixed.isEmpty();
case _0Package.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
return xMLNSPrefixMap != null && !xMLNSPrefixMap.isEmpty();
case _0Package.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
return xSISchemaLocation != null && !xSISchemaLocation.isEmpty();
case _0Package.DOCUMENT_ROOT__KEY:
return getKey() != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (mixed: ");
result.append(mixed);
result.append(')');
return result.toString();
}
} //DocumentRootImpl