org.openxma.dsl.dom.model.impl.ComplexTypeImpl Maven / Gradle / Ivy
/**
*
*
*
* $Id: ComplexTypeImpl.java 10224 2013-01-04 15:48:48Z dschwarz $
*/
package org.openxma.dsl.dom.model.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.openxma.dsl.core.model.impl.ModelElementImpl;
import org.openxma.dsl.dom.DomPackage;
import org.openxma.dsl.dom.model.Attribute;
import org.openxma.dsl.dom.model.ComplexType;
/**
*
* An implementation of the model object 'Complex Type'.
*
*
* The following features are implemented:
*
* - {@link org.openxma.dsl.dom.model.impl.ComplexTypeImpl#getAttributes Attributes}
* - {@link org.openxma.dsl.dom.model.impl.ComplexTypeImpl#getAllAttributes All Attributes}
*
*
*
* @generated
*/
public abstract class ComplexTypeImpl extends ModelElementImpl implements ComplexType {
/**
* The cached value of the '{@link #getAttributes() Attributes}' containment reference list.
*
*
* @see #getAttributes()
* @generated
* @ordered
*/
protected EList attributes;
/**
*
*
* @generated
*/
protected ComplexTypeImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return DomPackage.Literals.COMPLEX_TYPE;
}
/**
*
*
* @generated
*/
public EList getAttributes() {
if (attributes == null) {
attributes = new EObjectContainmentEList(Attribute.class, this, DomPackage.COMPLEX_TYPE__ATTRIBUTES);
}
return attributes;
}
/**
*
*
* @generated
*/
public EList getAllAttributes() {
// TODO: implement this method to return the 'All Attributes' reference list
// Ensure that you remove @generated or mark it @generated NOT
// The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting
// so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.EcoreEList should be used.
throw new UnsupportedOperationException();
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DomPackage.COMPLEX_TYPE__ATTRIBUTES:
return ((InternalEList)getAttributes()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DomPackage.COMPLEX_TYPE__ATTRIBUTES:
return getAttributes();
case DomPackage.COMPLEX_TYPE__ALL_ATTRIBUTES:
return getAllAttributes();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DomPackage.COMPLEX_TYPE__ATTRIBUTES:
getAttributes().clear();
getAttributes().addAll((Collection)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DomPackage.COMPLEX_TYPE__ATTRIBUTES:
getAttributes().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DomPackage.COMPLEX_TYPE__ATTRIBUTES:
return attributes != null && !attributes.isEmpty();
case DomPackage.COMPLEX_TYPE__ALL_ATTRIBUTES:
return !getAllAttributes().isEmpty();
}
return super.eIsSet(featureID);
}
} //ComplexTypeImpl