/**
*
*
*
* $Id$
*/
package org.w3.xlink.impl;
import org.eclipse.emf.common.notify.Notification;
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.ENotificationImpl;
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.w3.xlink.ActuateType;
import org.w3.xlink.DocumentRoot;
import org.w3.xlink.ShowType;
import org.w3.xlink.XlinkPackage;
/**
*
* An implementation of the model object 'Document Root'.
*
*
* The following features are implemented:
*
* - {@link org.w3.xlink.impl.DocumentRootImpl#getMixed Mixed}
* - {@link org.w3.xlink.impl.DocumentRootImpl#getXMLNSPrefixMap XMLNS Prefix Map}
* - {@link org.w3.xlink.impl.DocumentRootImpl#getXSISchemaLocation XSI Schema Location}
* - {@link org.w3.xlink.impl.DocumentRootImpl#getActuate Actuate}
* - {@link org.w3.xlink.impl.DocumentRootImpl#getArcrole Arcrole}
* - {@link org.w3.xlink.impl.DocumentRootImpl#getFrom From}
* - {@link org.w3.xlink.impl.DocumentRootImpl#getHref Href}
* - {@link org.w3.xlink.impl.DocumentRootImpl#getLabel Label}
* - {@link org.w3.xlink.impl.DocumentRootImpl#getRole Role}
* - {@link org.w3.xlink.impl.DocumentRootImpl#getShow Show}
* - {@link org.w3.xlink.impl.DocumentRootImpl#getTitle Title}
* - {@link org.w3.xlink.impl.DocumentRootImpl#getTo To}
*
*
*
* @generated
*/
public class DocumentRootImpl extends EObjectImpl implements DocumentRoot {
/**
* The cached value of the '{@link #getMixed() Mixed}' attribute list.
*
*
* @see #getMixed()
* @generated
* @ordered
*/
protected FeatureMap mixed;
/**
* The cached value of the '{@link #getXMLNSPrefixMap() XMLNS Prefix Map}' map.
*
*
* @see #getXMLNSPrefixMap()
* @generated
* @ordered
*/
protected EMap xMLNSPrefixMap;
/**
* The cached value of the '{@link #getXSISchemaLocation() XSI Schema Location}' map.
*
*
* @see #getXSISchemaLocation()
* @generated
* @ordered
*/
protected EMap xSISchemaLocation;
/**
* The default value of the '{@link #getActuate() Actuate}' attribute.
*
*
* @see #getActuate()
* @generated
* @ordered
*/
protected static final ActuateType ACTUATE_EDEFAULT = ActuateType.ON_LOAD_LITERAL;
/**
* The cached value of the '{@link #getActuate() Actuate}' attribute.
*
*
* @see #getActuate()
* @generated
* @ordered
*/
protected ActuateType actuate = ACTUATE_EDEFAULT;
/**
* This is true if the Actuate attribute has been set.
*
*
* @generated
* @ordered
*/
protected boolean actuateESet;
/**
* The default value of the '{@link #getArcrole() Arcrole}' attribute.
*
*
* @see #getArcrole()
* @generated
* @ordered
*/
protected static final String ARCROLE_EDEFAULT = null;
/**
* The cached value of the '{@link #getArcrole() Arcrole}' attribute.
*
*
* @see #getArcrole()
* @generated
* @ordered
*/
protected String arcrole = ARCROLE_EDEFAULT;
/**
* The default value of the '{@link #getFrom() From}' attribute.
*
*
* @see #getFrom()
* @generated
* @ordered
*/
protected static final String FROM_EDEFAULT = null;
/**
* The cached value of the '{@link #getFrom() From}' attribute.
*
*
* @see #getFrom()
* @generated
* @ordered
*/
protected String from = FROM_EDEFAULT;
/**
* The default value of the '{@link #getHref() Href}' attribute.
*
*
* @see #getHref()
* @generated
* @ordered
*/
protected static final String HREF_EDEFAULT = null;
/**
* The cached value of the '{@link #getHref() Href}' attribute.
*
*
* @see #getHref()
* @generated
* @ordered
*/
protected String href = HREF_EDEFAULT;
/**
* The default value of the '{@link #getLabel() Label}' attribute.
*
*
* @see #getLabel()
* @generated
* @ordered
*/
protected static final String LABEL_EDEFAULT = null;
/**
* The cached value of the '{@link #getLabel() Label}' attribute.
*
*
* @see #getLabel()
* @generated
* @ordered
*/
protected String label = LABEL_EDEFAULT;
/**
* The default value of the '{@link #getRole() Role}' attribute.
*
*
* @see #getRole()
* @generated
* @ordered
*/
protected static final String ROLE_EDEFAULT = null;
/**
* The cached value of the '{@link #getRole() Role}' attribute.
*
*
* @see #getRole()
* @generated
* @ordered
*/
protected String role = ROLE_EDEFAULT;
/**
* The default value of the '{@link #getShow() Show}' attribute.
*
*
* @see #getShow()
* @generated
* @ordered
*/
protected static final ShowType SHOW_EDEFAULT = ShowType.NEW_LITERAL;
/**
* The cached value of the '{@link #getShow() Show}' attribute.
*
*
* @see #getShow()
* @generated
* @ordered
*/
protected ShowType show = SHOW_EDEFAULT;
/**
* This is true if the Show attribute has been set.
*
*
* @generated
* @ordered
*/
protected boolean showESet;
/**
* The default value of the '{@link #getTitle() Title}' attribute.
*
*
* @see #getTitle()
* @generated
* @ordered
*/
protected static final String TITLE_EDEFAULT = null;
/**
* The cached value of the '{@link #getTitle() Title}' attribute.
*
*
* @see #getTitle()
* @generated
* @ordered
*/
protected String title = TITLE_EDEFAULT;
/**
* The default value of the '{@link #getTo() To}' attribute.
*
*
* @see #getTo()
* @generated
* @ordered
*/
protected static final String TO_EDEFAULT = null;
/**
* The cached value of the '{@link #getTo() To}' attribute.
*
*
* @see #getTo()
* @generated
* @ordered
*/
protected String to = TO_EDEFAULT;
/**
*
*
* @generated
*/
protected DocumentRootImpl() {
super();
}
/**
*
*
* @generated
*/
protected EClass eStaticClass() {
return XlinkPackage.Literals.DOCUMENT_ROOT;
}
/**
*
*
* @generated
*/
public FeatureMap getMixed() {
if (mixed == null) {
mixed = new BasicFeatureMap(this, XlinkPackage.DOCUMENT_ROOT__MIXED);
}
return mixed;
}
/**
*
*
* @generated
*/
public EMap getXMLNSPrefixMap() {
if (xMLNSPrefixMap == null) {
xMLNSPrefixMap = new EcoreEMap(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, EStringToStringMapEntryImpl.class, this, XlinkPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP);
}
return xMLNSPrefixMap;
}
/**
*
*
* @generated
*/
public EMap getXSISchemaLocation() {
if (xSISchemaLocation == null) {
xSISchemaLocation = new EcoreEMap(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, EStringToStringMapEntryImpl.class, this, XlinkPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION);
}
return xSISchemaLocation;
}
/**
*
*
* @generated
*/
public ActuateType getActuate() {
return actuate;
}
/**
*
*
* @generated
*/
public void setActuate(ActuateType newActuate) {
ActuateType oldActuate = actuate;
actuate = newActuate == null ? ACTUATE_EDEFAULT : newActuate;
boolean oldActuateESet = actuateESet;
actuateESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XlinkPackage.DOCUMENT_ROOT__ACTUATE, oldActuate, actuate, !oldActuateESet));
}
/**
*
*
* @generated
*/
public void unsetActuate() {
ActuateType oldActuate = actuate;
boolean oldActuateESet = actuateESet;
actuate = ACTUATE_EDEFAULT;
actuateESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, XlinkPackage.DOCUMENT_ROOT__ACTUATE, oldActuate, ACTUATE_EDEFAULT, oldActuateESet));
}
/**
*
*
* @generated
*/
public boolean isSetActuate() {
return actuateESet;
}
/**
*
*
* @generated
*/
public String getArcrole() {
return arcrole;
}
/**
*
*
* @generated
*/
public void setArcrole(String newArcrole) {
String oldArcrole = arcrole;
arcrole = newArcrole;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XlinkPackage.DOCUMENT_ROOT__ARCROLE, oldArcrole, arcrole));
}
/**
*
*
* @generated
*/
public String getFrom() {
return from;
}
/**
*
*
* @generated
*/
public void setFrom(String newFrom) {
String oldFrom = from;
from = newFrom;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XlinkPackage.DOCUMENT_ROOT__FROM, oldFrom, from));
}
/**
*
*
* @generated
*/
public String getHref() {
return href;
}
/**
*
*
* @generated
*/
public void setHref(String newHref) {
String oldHref = href;
href = newHref;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XlinkPackage.DOCUMENT_ROOT__HREF, oldHref, href));
}
/**
*
*
* @generated
*/
public String getLabel() {
return label;
}
/**
*
*
* @generated
*/
public void setLabel(String newLabel) {
String oldLabel = label;
label = newLabel;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XlinkPackage.DOCUMENT_ROOT__LABEL, oldLabel, label));
}
/**
*
*
* @generated
*/
public String getRole() {
return role;
}
/**
*
*
* @generated
*/
public void setRole(String newRole) {
String oldRole = role;
role = newRole;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XlinkPackage.DOCUMENT_ROOT__ROLE, oldRole, role));
}
/**
*
*
* @generated
*/
public ShowType getShow() {
return show;
}
/**
*
*
* @generated
*/
public void setShow(ShowType newShow) {
ShowType oldShow = show;
show = newShow == null ? SHOW_EDEFAULT : newShow;
boolean oldShowESet = showESet;
showESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XlinkPackage.DOCUMENT_ROOT__SHOW, oldShow, show, !oldShowESet));
}
/**
*
*
* @generated
*/
public void unsetShow() {
ShowType oldShow = show;
boolean oldShowESet = showESet;
show = SHOW_EDEFAULT;
showESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, XlinkPackage.DOCUMENT_ROOT__SHOW, oldShow, SHOW_EDEFAULT, oldShowESet));
}
/**
*
*
* @generated
*/
public boolean isSetShow() {
return showESet;
}
/**
*
*
* @generated
*/
public String getTitle() {
return title;
}
/**
*
*
* @generated
*/
public void setTitle(String newTitle) {
String oldTitle = title;
title = newTitle;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XlinkPackage.DOCUMENT_ROOT__TITLE, oldTitle, title));
}
/**
*
*
* @generated
*/
public String getTo() {
return to;
}
/**
*
*
* @generated
*/
public void setTo(String newTo) {
String oldTo = to;
to = newTo;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XlinkPackage.DOCUMENT_ROOT__TO, oldTo, to));
}
/**
*
*
* @generated
*/
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case XlinkPackage.DOCUMENT_ROOT__MIXED:
return ((InternalEList)getMixed()).basicRemove(otherEnd, msgs);
case XlinkPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
return ((InternalEList)getXMLNSPrefixMap()).basicRemove(otherEnd, msgs);
case XlinkPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
return ((InternalEList)getXSISchemaLocation()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case XlinkPackage.DOCUMENT_ROOT__MIXED:
if (coreType) return getMixed();
return ((FeatureMap.Internal)getMixed()).getWrapper();
case XlinkPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
if (coreType) return getXMLNSPrefixMap();
else return getXMLNSPrefixMap().map();
case XlinkPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
if (coreType) return getXSISchemaLocation();
else return getXSISchemaLocation().map();
case XlinkPackage.DOCUMENT_ROOT__ACTUATE:
return getActuate();
case XlinkPackage.DOCUMENT_ROOT__ARCROLE:
return getArcrole();
case XlinkPackage.DOCUMENT_ROOT__FROM:
return getFrom();
case XlinkPackage.DOCUMENT_ROOT__HREF:
return getHref();
case XlinkPackage.DOCUMENT_ROOT__LABEL:
return getLabel();
case XlinkPackage.DOCUMENT_ROOT__ROLE:
return getRole();
case XlinkPackage.DOCUMENT_ROOT__SHOW:
return getShow();
case XlinkPackage.DOCUMENT_ROOT__TITLE:
return getTitle();
case XlinkPackage.DOCUMENT_ROOT__TO:
return getTo();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case XlinkPackage.DOCUMENT_ROOT__MIXED:
((FeatureMap.Internal)getMixed()).set(newValue);
return;
case XlinkPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
((EStructuralFeature.Setting)getXMLNSPrefixMap()).set(newValue);
return;
case XlinkPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
((EStructuralFeature.Setting)getXSISchemaLocation()).set(newValue);
return;
case XlinkPackage.DOCUMENT_ROOT__ACTUATE:
setActuate((ActuateType)newValue);
return;
case XlinkPackage.DOCUMENT_ROOT__ARCROLE:
setArcrole((String)newValue);
return;
case XlinkPackage.DOCUMENT_ROOT__FROM:
setFrom((String)newValue);
return;
case XlinkPackage.DOCUMENT_ROOT__HREF:
setHref((String)newValue);
return;
case XlinkPackage.DOCUMENT_ROOT__LABEL:
setLabel((String)newValue);
return;
case XlinkPackage.DOCUMENT_ROOT__ROLE:
setRole((String)newValue);
return;
case XlinkPackage.DOCUMENT_ROOT__SHOW:
setShow((ShowType)newValue);
return;
case XlinkPackage.DOCUMENT_ROOT__TITLE:
setTitle((String)newValue);
return;
case XlinkPackage.DOCUMENT_ROOT__TO:
setTo((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case XlinkPackage.DOCUMENT_ROOT__MIXED:
getMixed().clear();
return;
case XlinkPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
getXMLNSPrefixMap().clear();
return;
case XlinkPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
getXSISchemaLocation().clear();
return;
case XlinkPackage.DOCUMENT_ROOT__ACTUATE:
unsetActuate();
return;
case XlinkPackage.DOCUMENT_ROOT__ARCROLE:
setArcrole(ARCROLE_EDEFAULT);
return;
case XlinkPackage.DOCUMENT_ROOT__FROM:
setFrom(FROM_EDEFAULT);
return;
case XlinkPackage.DOCUMENT_ROOT__HREF:
setHref(HREF_EDEFAULT);
return;
case XlinkPackage.DOCUMENT_ROOT__LABEL:
setLabel(LABEL_EDEFAULT);
return;
case XlinkPackage.DOCUMENT_ROOT__ROLE:
setRole(ROLE_EDEFAULT);
return;
case XlinkPackage.DOCUMENT_ROOT__SHOW:
unsetShow();
return;
case XlinkPackage.DOCUMENT_ROOT__TITLE:
setTitle(TITLE_EDEFAULT);
return;
case XlinkPackage.DOCUMENT_ROOT__TO:
setTo(TO_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case XlinkPackage.DOCUMENT_ROOT__MIXED:
return mixed != null && !mixed.isEmpty();
case XlinkPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
return xMLNSPrefixMap != null && !xMLNSPrefixMap.isEmpty();
case XlinkPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
return xSISchemaLocation != null && !xSISchemaLocation.isEmpty();
case XlinkPackage.DOCUMENT_ROOT__ACTUATE:
return isSetActuate();
case XlinkPackage.DOCUMENT_ROOT__ARCROLE:
return ARCROLE_EDEFAULT == null ? arcrole != null : !ARCROLE_EDEFAULT.equals(arcrole);
case XlinkPackage.DOCUMENT_ROOT__FROM:
return FROM_EDEFAULT == null ? from != null : !FROM_EDEFAULT.equals(from);
case XlinkPackage.DOCUMENT_ROOT__HREF:
return HREF_EDEFAULT == null ? href != null : !HREF_EDEFAULT.equals(href);
case XlinkPackage.DOCUMENT_ROOT__LABEL:
return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label);
case XlinkPackage.DOCUMENT_ROOT__ROLE:
return ROLE_EDEFAULT == null ? role != null : !ROLE_EDEFAULT.equals(role);
case XlinkPackage.DOCUMENT_ROOT__SHOW:
return isSetShow();
case XlinkPackage.DOCUMENT_ROOT__TITLE:
return TITLE_EDEFAULT == null ? title != null : !TITLE_EDEFAULT.equals(title);
case XlinkPackage.DOCUMENT_ROOT__TO:
return TO_EDEFAULT == null ? to != null : !TO_EDEFAULT.equals(to);
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (mixed: ");
result.append(mixed);
result.append(", actuate: ");
if (actuateESet) result.append(actuate); else result.append("");
result.append(", arcrole: ");
result.append(arcrole);
result.append(", from: ");
result.append(from);
result.append(", href: ");
result.append(href);
result.append(", label: ");
result.append(label);
result.append(", role: ");
result.append(role);
result.append(", show: ");
if (showESet) result.append(show); else result.append("");
result.append(", title: ");
result.append(title);
result.append(", to: ");
result.append(to);
result.append(')');
return result.toString();
}
} //DocumentRootImpl