org.openxma.dsl.dom.model.impl.AttributeImpl Maven / Gradle / Ivy
/**
*
*
*
* $Id: AttributeImpl.java 10627 2013-04-10 09:59:28Z dschwarz $
*/
package org.openxma.dsl.dom.model.impl;
import java.util.Collection;
import java.util.Iterator;
import org.eclipse.emf.common.notify.Notification;
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.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.openxma.dsl.core.CorePackage;
import org.openxma.dsl.core.CoreFactory;
import org.openxma.dsl.core.model.DataTypeAndTypeParameter;
import org.openxma.dsl.core.model.IDocumentable;
import org.openxma.dsl.core.model.IncrementerReference;
import org.openxma.dsl.core.model.TrueLiteral;
import org.openxma.dsl.core.model.Type;
import org.openxma.dsl.core.model.ValidatorReference;
import org.openxma.dsl.core.model.impl.ReferenceableByXmadslVariableImpl;
import org.openxma.dsl.dom.DomPackage;
import org.openxma.dsl.dom.model.Attribute;
import org.openxma.dsl.dom.model.AttributeGroup;
import org.openxma.dsl.dom.model.AttributeProperty;
import org.openxma.dsl.dom.model.AttributeValidationProperty;
import org.openxma.dsl.dom.model.DerivedFlag;
import org.openxma.dsl.dom.model.Entity;
import org.openxma.dsl.dom.model.PresentableFeature;
import org.openxma.dsl.dom.model.QueryParameterReference;
import org.openxma.dsl.dom.model.ReadOnlyFlag;
import org.openxma.dsl.dom.model.RequiredFlag;
import org.openxma.dsl.dom.model.TransientFlag;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
/**
* An implementation of the model object '
* Attribute'.
*
* The following features are implemented:
*
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#getName Name}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#getTxtDescription Txt Description}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#isIdentifier Identifier}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#isVersion Version}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#isComposition Composition}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#getType Type}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#isMany Many}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#getIncrementerReference Incrementer Reference}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#getDefaultValue Default Value}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#getOpposite Opposite}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#getAttributProperties Attribut Properties}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#getSortOrder Sort Order}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#getDataType Data Type}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#getOppositeReference Opposite Reference}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#getDataTypeName Data Type Name}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#getResolvedAttributeList Resolved Attribute List}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#isReference Reference}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#isReadOnly Read Only}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#isRequired Required}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#isDerived Derived}
* - {@link org.openxma.dsl.dom.model.impl.AttributeImpl#isTransient Transient}
*
*
*
* @generated
*/
public class AttributeImpl extends ReferenceableByXmadslVariableImpl implements Attribute {
/**
* The default value of the '{@link #getName() Name}' attribute.
*
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() Name}' attribute.
*
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #getTxtDescription() Txt Description}' attribute.
*
*
* @see #getTxtDescription()
* @generated
* @ordered
*/
protected static final String TXT_DESCRIPTION_EDEFAULT = null;
/**
* The cached value of the '{@link #getTxtDescription() Txt Description}' attribute.
*
*
* @see #getTxtDescription()
* @generated
* @ordered
*/
protected String txtDescription = TXT_DESCRIPTION_EDEFAULT;
/**
* The default value of the '{@link #isIdentifier() Identifier}' attribute.
*
* @see #isIdentifier()
* @generated
* @ordered
*/
protected static final boolean IDENTIFIER_EDEFAULT = false;
/**
* The cached value of the '{@link #isIdentifier() Identifier}' attribute.
*
* @see #isIdentifier()
* @generated
* @ordered
*/
protected boolean identifier = IDENTIFIER_EDEFAULT;
/**
* The default value of the '{@link #isVersion() Version}' attribute.
*
* @see #isVersion()
* @generated
* @ordered
*/
protected static final boolean VERSION_EDEFAULT = false;
/**
* The cached value of the '{@link #isVersion() Version}' attribute.
*
* @see #isVersion()
* @generated
* @ordered
*/
protected boolean version = VERSION_EDEFAULT;
/**
* The default value of the '{@link #isComposition() Composition}' attribute.
*
* @see #isComposition()
* @generated
* @ordered
*/
protected static final boolean COMPOSITION_EDEFAULT = false;
/**
* The cached value of the '{@link #isComposition() Composition}' attribute.
*
* @see #isComposition()
* @generated
* @ordered
*/
protected boolean composition = COMPOSITION_EDEFAULT;
/**
* The cached value of the '{@link #getType() Type}' containment reference.
*
* @see #getType()
* @generated
* @ordered
*/
protected DataTypeAndTypeParameter type;
/**
* The default value of the '{@link #isMany() Many}' attribute.
*
* @see #isMany()
* @generated
* @ordered
*/
protected static final boolean MANY_EDEFAULT = false;
/**
* The cached value of the '{@link #isMany() Many}' attribute.
*
* @see #isMany()
* @generated
* @ordered
*/
protected boolean many = MANY_EDEFAULT;
/**
* The cached value of the '{@link #getIncrementerReference()
* Incrementer Reference}' containment reference.
*
* @see #getIncrementerReference()
* @generated
* @ordered
*/
protected IncrementerReference incrementerReference;
/**
* The default value of the '{@link #getDefaultValue() Default Value}' attribute.
*
* @see #getDefaultValue()
* @generated
* @ordered
*/
protected static final String DEFAULT_VALUE_EDEFAULT = null;
/**
* The cached value of the '{@link #getDefaultValue() Default Value}' attribute.
*
* @see #getDefaultValue()
* @generated
* @ordered
*/
protected String defaultValue = DEFAULT_VALUE_EDEFAULT;
/**
* The cached value of the '{@link #getOpposite() Opposite}' reference.
*
* @see #getOpposite()
* @generated
* @ordered
*/
protected Attribute opposite;
/**
* The cached value of the '{@link #getAttributProperties()
* Attribut Properties}' containment reference list.
*
* @see #getAttributProperties()
* @generated
* @ordered
*/
protected EList attributProperties;
/**
* The cached value of the '{@link #getSortOrder() Sort Order}' reference.
*
* @see #getSortOrder()
* @generated
* @ordered
*/
protected AttributeGroup sortOrder;
/**
* The default value of the '{@link #getDataTypeName() Data Type Name}' attribute.
*
* @see #getDataTypeName()
* @generated
* @ordered
*/
protected static final String DATA_TYPE_NAME_EDEFAULT = null;
/**
* The default value of the '{@link #isReference() Reference}' attribute.
*
* @see #isReference()
* @generated
* @ordered
*/
protected static final boolean REFERENCE_EDEFAULT = false;
/**
* The default value of the '{@link #isReadOnly() Read Only}' attribute.
*
* @see #isReadOnly()
* @generated
* @ordered
*/
protected static final boolean READ_ONLY_EDEFAULT = false;
/**
* The default value of the '{@link #isRequired() Required}' attribute.
*
* @see #isRequired()
* @generated
* @ordered
*/
protected static final boolean REQUIRED_EDEFAULT = false;
/**
* The default value of the '{@link #isDerived() Derived}' attribute.
*
* @see #isDerived()
* @generated
* @ordered
*/
protected static final boolean DERIVED_EDEFAULT = false;
/**
* The default value of the '{@link #isTransient() Transient}' attribute.
*
* @see #isTransient()
* @generated
* @ordered
*/
protected static final boolean TRANSIENT_EDEFAULT = false;
private Boolean readOnly;
private Boolean required;
private Boolean derived;
private Boolean transientFlag;
/**
*
* @generated
*/
protected AttributeImpl() {
super();
}
/**
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return DomPackage.Literals.ATTRIBUTE;
}
/**
*
* @generated
*/
public String getName() {
return name;
}
/**
*
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.ATTRIBUTE__NAME, oldName, name));
}
/**
*
*
* @generated
*/
public String getTxtDescription() {
return txtDescription;
}
/**
*
*
* @generated
*/
public void setTxtDescription(String newTxtDescription) {
String oldTxtDescription = txtDescription;
txtDescription = newTxtDescription;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.ATTRIBUTE__TXT_DESCRIPTION, oldTxtDescription, txtDescription));
}
/**
*
*
* @generated NOT
*/
public Type getDataType() {
if (getType() != null && getType().getDataType() instanceof Type) {
return (Type) getType().getDataType();
}
return null;
}
/**
*
*
* @generated NOT
*/
public void setDataType(Type newDataType) {
if (getType() == null) {
DataTypeAndTypeParameter dataTypeAndTypeParameter = CoreFactory.eINSTANCE.createDataTypeAndTypeParameter();
dataTypeAndTypeParameter.setDataType(newDataType);
setType(dataTypeAndTypeParameter);
} else {
getType().setDataType(newDataType);
}
}
/**
*
*
* @generated NOT
*/
public Attribute getOppositeReference() {
if (oppositeReference == null) {
if (opposite != null) {
oppositeReference = opposite;
} else if (getDataType() instanceof Entity) {
Entity entity = (Entity) getDataType();
for (Iterator iterator = entity.getAllAttributes().iterator(); null == oppositeReference
&& iterator.hasNext();) {
Attribute attribute = iterator.next();
if (this.equals(attribute.getOpposite())) {
oppositeReference = attribute;
}
}
}
}
return oppositeReference;
}
private Attribute oppositeReference;
/**
*
*
* @generated NOT
*/
public String getDataTypeName() {
return getDataType() != null ? getDataType().getName() : "";
}
/**
*
*
* @generated NOT
*/
public boolean isReference() {
return getDataType() instanceof Entity;
}
/**
*
*
* @generated NOT
*/
public EList getResolvedAttributeList() {
EList resolvedAttributeList = new EObjectEList(Attribute.class, this, DomPackage.ATTRIBUTE__RESOLVED_ATTRIBUTE_LIST);
if (isReference()) {
Entity entity = (Entity) getDataType();
resolvedAttributeList.addAll(entity.getResolvedAttributeList());
} else {
resolvedAttributeList.add(this);
}
return resolvedAttributeList;
}
/**
*
* @generated
*/
public boolean isIdentifier() {
return identifier;
}
/**
*
* @generated
*/
public void setIdentifier(boolean newIdentifier) {
boolean oldIdentifier = identifier;
identifier = newIdentifier;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.ATTRIBUTE__IDENTIFIER, oldIdentifier, identifier));
}
/**
*
* @generated
*/
public boolean isVersion() {
return version;
}
/**
*
* @generated
*/
public void setVersion(boolean newVersion) {
boolean oldVersion = version;
version = newVersion;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.ATTRIBUTE__VERSION, oldVersion, version));
}
/**
*
* @generated
*/
public boolean isComposition() {
return composition;
}
/**
*
* @generated
*/
public void setComposition(boolean newComposition) {
boolean oldComposition = composition;
composition = newComposition;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.ATTRIBUTE__COMPOSITION, oldComposition, composition));
}
/**
*
* @generated
*/
public DataTypeAndTypeParameter getType() {
return type;
}
/**
*
* @generated
*/
public NotificationChain basicSetType(DataTypeAndTypeParameter newType, NotificationChain msgs) {
DataTypeAndTypeParameter oldType = type;
type = newType;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DomPackage.ATTRIBUTE__TYPE, oldType, newType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
* @generated
*/
public void setType(DataTypeAndTypeParameter newType) {
if (newType != type) {
NotificationChain msgs = null;
if (type != null)
msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DomPackage.ATTRIBUTE__TYPE, null, msgs);
if (newType != null)
msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DomPackage.ATTRIBUTE__TYPE, null, msgs);
msgs = basicSetType(newType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.ATTRIBUTE__TYPE, newType, newType));
}
/**
*
* @generated
*/
public boolean isMany() {
return many;
}
/**
*
* @generated
*/
public void setMany(boolean newMany) {
boolean oldMany = many;
many = newMany;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.ATTRIBUTE__MANY, oldMany, many));
}
/**
*
* @generated
*/
public String getDefaultValue() {
return defaultValue;
}
/**
*
* @generated
*/
public void setDefaultValue(String newDefaultValue) {
String oldDefaultValue = defaultValue;
defaultValue = newDefaultValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.ATTRIBUTE__DEFAULT_VALUE, oldDefaultValue, defaultValue));
}
/**
*
* @generated
*/
public Attribute getOpposite() {
if (opposite != null && opposite.eIsProxy()) {
InternalEObject oldOpposite = (InternalEObject)opposite;
opposite = (Attribute)eResolveProxy(oldOpposite);
if (opposite != oldOpposite) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, DomPackage.ATTRIBUTE__OPPOSITE, oldOpposite, opposite));
}
}
return opposite;
}
/**
*
* @generated
*/
public Attribute basicGetOpposite() {
return opposite;
}
/**
*
* @generated
*/
public void setOpposite(Attribute newOpposite) {
Attribute oldOpposite = opposite;
opposite = newOpposite;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.ATTRIBUTE__OPPOSITE, oldOpposite, opposite));
}
/**
*
* @generated
*/
public EList getAttributProperties() {
if (attributProperties == null) {
attributProperties = new EObjectContainmentEList(AttributeProperty.class, this, DomPackage.ATTRIBUTE__ATTRIBUT_PROPERTIES);
}
return attributProperties;
}
/**
*
* @generated
*/
public AttributeGroup getSortOrder() {
if (sortOrder != null && sortOrder.eIsProxy()) {
InternalEObject oldSortOrder = (InternalEObject)sortOrder;
sortOrder = (AttributeGroup)eResolveProxy(oldSortOrder);
if (sortOrder != oldSortOrder) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, DomPackage.ATTRIBUTE__SORT_ORDER, oldSortOrder, sortOrder));
}
}
return sortOrder;
}
/**
*
* @generated
*/
public AttributeGroup basicGetSortOrder() {
return sortOrder;
}
/**
*
* @generated
*/
public void setSortOrder(AttributeGroup newSortOrder) {
AttributeGroup oldSortOrder = sortOrder;
sortOrder = newSortOrder;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.ATTRIBUTE__SORT_ORDER, oldSortOrder, sortOrder));
}
/**
* @modified
*/
public boolean isReadOnly() {
if (readOnly == null) {
readOnly = Iterables.any(getAttributProperties(), new Predicate() {
public boolean apply(AttributeProperty attributeProperty) {
if (attributeProperty instanceof ReadOnlyFlag) {
return Iterators.any(((ReadOnlyFlag) attributeProperty).getExpression().eAllContents(),
new Predicate() {
public boolean apply(EObject eObject) {
return eObject instanceof TrueLiteral;
}
});
}
return false;
}
})
|| (isDerived() && isTransient());
}
return readOnly;
}
/**
*
*
* @generated NOT
*/
public boolean isSetReadOnly() {
return readOnly != null;
}
/**
* @modified
*/
public boolean isRequired() {
if (required == null) {
required = Iterables.any(getAttributProperties(), new Predicate() {
public boolean apply(AttributeProperty attributeProperty) {
if (attributeProperty instanceof RequiredFlag) {
return Iterators.any(((RequiredFlag) attributeProperty).getExpression().eAllContents(),
new Predicate() {
public boolean apply(EObject eObject) {
return eObject instanceof TrueLiteral;
}
});
}
return false;
}
});
} return required;
}
/**
*
*
* @generated NOT
*/
public boolean isSetRequired() {
return required != null;
}
/**
* @modified
*/
public boolean isDerived() {
if (derived == null) {
derived = Iterables.any(getAttributProperties(), new Predicate() {
public boolean apply(AttributeProperty arg0) {
return arg0 instanceof DerivedFlag && ((DerivedFlag) arg0).getExpression() instanceof TrueLiteral;
}
});
}
return derived;
}
/**
*
*
* @generated NOT
*/
public boolean isSetDerived() {
return derived != null;
}
/**
* @modified
*/
public boolean isTransient() {
if (transientFlag == null) {
transientFlag = Iterables.any(getAttributProperties(), new Predicate() {
public boolean apply(AttributeProperty arg0) {
return arg0 instanceof TransientFlag && ((TransientFlag) arg0).getExpression() instanceof TrueLiteral;
}
});
}
return transientFlag;
}
/**
*
*
* @generated NOT
*/
public boolean isSetTransient() {
return transientFlag != null;
}
/**
*
* @generated
*/
public IncrementerReference getIncrementerReference() {
return incrementerReference;
}
/**
*
* @generated
*/
public NotificationChain basicSetIncrementerReference(IncrementerReference newIncrementerReference,
NotificationChain msgs) {
IncrementerReference oldIncrementerReference = incrementerReference;
incrementerReference = newIncrementerReference;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DomPackage.ATTRIBUTE__INCREMENTER_REFERENCE, oldIncrementerReference, newIncrementerReference);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
* @generated
*/
public void setIncrementerReference(IncrementerReference newIncrementerReference) {
if (newIncrementerReference != incrementerReference) {
NotificationChain msgs = null;
if (incrementerReference != null)
msgs = ((InternalEObject)incrementerReference).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DomPackage.ATTRIBUTE__INCREMENTER_REFERENCE, null, msgs);
if (newIncrementerReference != null)
msgs = ((InternalEObject)newIncrementerReference).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DomPackage.ATTRIBUTE__INCREMENTER_REFERENCE, null, msgs);
msgs = basicSetIncrementerReference(newIncrementerReference, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.ATTRIBUTE__INCREMENTER_REFERENCE, newIncrementerReference, newIncrementerReference));
}
/**
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DomPackage.ATTRIBUTE__TYPE:
return basicSetType(null, msgs);
case DomPackage.ATTRIBUTE__INCREMENTER_REFERENCE:
return basicSetIncrementerReference(null, msgs);
case DomPackage.ATTRIBUTE__ATTRIBUT_PROPERTIES:
return ((InternalEList)getAttributProperties()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DomPackage.ATTRIBUTE__NAME:
return getName();
case DomPackage.ATTRIBUTE__TXT_DESCRIPTION:
return getTxtDescription();
case DomPackage.ATTRIBUTE__IDENTIFIER:
return isIdentifier();
case DomPackage.ATTRIBUTE__VERSION:
return isVersion();
case DomPackage.ATTRIBUTE__COMPOSITION:
return isComposition();
case DomPackage.ATTRIBUTE__TYPE:
return getType();
case DomPackage.ATTRIBUTE__MANY:
return isMany();
case DomPackage.ATTRIBUTE__INCREMENTER_REFERENCE:
return getIncrementerReference();
case DomPackage.ATTRIBUTE__DEFAULT_VALUE:
return getDefaultValue();
case DomPackage.ATTRIBUTE__OPPOSITE:
if (resolve) return getOpposite();
return basicGetOpposite();
case DomPackage.ATTRIBUTE__ATTRIBUT_PROPERTIES:
return getAttributProperties();
case DomPackage.ATTRIBUTE__SORT_ORDER:
if (resolve) return getSortOrder();
return basicGetSortOrder();
case DomPackage.ATTRIBUTE__DATA_TYPE:
return getDataType();
case DomPackage.ATTRIBUTE__OPPOSITE_REFERENCE:
return getOppositeReference();
case DomPackage.ATTRIBUTE__DATA_TYPE_NAME:
return getDataTypeName();
case DomPackage.ATTRIBUTE__RESOLVED_ATTRIBUTE_LIST:
return getResolvedAttributeList();
case DomPackage.ATTRIBUTE__REFERENCE:
return isReference();
case DomPackage.ATTRIBUTE__READ_ONLY:
return isReadOnly();
case DomPackage.ATTRIBUTE__REQUIRED:
return isRequired();
case DomPackage.ATTRIBUTE__DERIVED:
return isDerived();
case DomPackage.ATTRIBUTE__TRANSIENT:
return isTransient();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DomPackage.ATTRIBUTE__NAME:
setName((String)newValue);
return;
case DomPackage.ATTRIBUTE__TXT_DESCRIPTION:
setTxtDescription((String)newValue);
return;
case DomPackage.ATTRIBUTE__IDENTIFIER:
setIdentifier((Boolean)newValue);
return;
case DomPackage.ATTRIBUTE__VERSION:
setVersion((Boolean)newValue);
return;
case DomPackage.ATTRIBUTE__COMPOSITION:
setComposition((Boolean)newValue);
return;
case DomPackage.ATTRIBUTE__TYPE:
setType((DataTypeAndTypeParameter)newValue);
return;
case DomPackage.ATTRIBUTE__MANY:
setMany((Boolean)newValue);
return;
case DomPackage.ATTRIBUTE__INCREMENTER_REFERENCE:
setIncrementerReference((IncrementerReference)newValue);
return;
case DomPackage.ATTRIBUTE__DEFAULT_VALUE:
setDefaultValue((String)newValue);
return;
case DomPackage.ATTRIBUTE__OPPOSITE:
setOpposite((Attribute)newValue);
return;
case DomPackage.ATTRIBUTE__ATTRIBUT_PROPERTIES:
getAttributProperties().clear();
getAttributProperties().addAll((Collection)newValue);
return;
case DomPackage.ATTRIBUTE__SORT_ORDER:
setSortOrder((AttributeGroup)newValue);
return;
case DomPackage.ATTRIBUTE__DATA_TYPE:
setDataType((Type)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DomPackage.ATTRIBUTE__NAME:
setName(NAME_EDEFAULT);
return;
case DomPackage.ATTRIBUTE__TXT_DESCRIPTION:
setTxtDescription(TXT_DESCRIPTION_EDEFAULT);
return;
case DomPackage.ATTRIBUTE__IDENTIFIER:
setIdentifier(IDENTIFIER_EDEFAULT);
return;
case DomPackage.ATTRIBUTE__VERSION:
setVersion(VERSION_EDEFAULT);
return;
case DomPackage.ATTRIBUTE__COMPOSITION:
setComposition(COMPOSITION_EDEFAULT);
return;
case DomPackage.ATTRIBUTE__TYPE:
setType((DataTypeAndTypeParameter)null);
return;
case DomPackage.ATTRIBUTE__MANY:
setMany(MANY_EDEFAULT);
return;
case DomPackage.ATTRIBUTE__INCREMENTER_REFERENCE:
setIncrementerReference((IncrementerReference)null);
return;
case DomPackage.ATTRIBUTE__DEFAULT_VALUE:
setDefaultValue(DEFAULT_VALUE_EDEFAULT);
return;
case DomPackage.ATTRIBUTE__OPPOSITE:
setOpposite((Attribute)null);
return;
case DomPackage.ATTRIBUTE__ATTRIBUT_PROPERTIES:
getAttributProperties().clear();
return;
case DomPackage.ATTRIBUTE__SORT_ORDER:
setSortOrder((AttributeGroup)null);
return;
case DomPackage.ATTRIBUTE__DATA_TYPE:
setDataType((Type)null);
return;
}
super.eUnset(featureID);
}
/**
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DomPackage.ATTRIBUTE__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case DomPackage.ATTRIBUTE__TXT_DESCRIPTION:
return TXT_DESCRIPTION_EDEFAULT == null ? txtDescription != null : !TXT_DESCRIPTION_EDEFAULT.equals(txtDescription);
case DomPackage.ATTRIBUTE__IDENTIFIER:
return identifier != IDENTIFIER_EDEFAULT;
case DomPackage.ATTRIBUTE__VERSION:
return version != VERSION_EDEFAULT;
case DomPackage.ATTRIBUTE__COMPOSITION:
return composition != COMPOSITION_EDEFAULT;
case DomPackage.ATTRIBUTE__TYPE:
return type != null;
case DomPackage.ATTRIBUTE__MANY:
return many != MANY_EDEFAULT;
case DomPackage.ATTRIBUTE__INCREMENTER_REFERENCE:
return incrementerReference != null;
case DomPackage.ATTRIBUTE__DEFAULT_VALUE:
return DEFAULT_VALUE_EDEFAULT == null ? defaultValue != null : !DEFAULT_VALUE_EDEFAULT.equals(defaultValue);
case DomPackage.ATTRIBUTE__OPPOSITE:
return opposite != null;
case DomPackage.ATTRIBUTE__ATTRIBUT_PROPERTIES:
return attributProperties != null && !attributProperties.isEmpty();
case DomPackage.ATTRIBUTE__SORT_ORDER:
return sortOrder != null;
case DomPackage.ATTRIBUTE__DATA_TYPE:
return getDataType() != null;
case DomPackage.ATTRIBUTE__OPPOSITE_REFERENCE:
return getOppositeReference() != null;
case DomPackage.ATTRIBUTE__DATA_TYPE_NAME:
return DATA_TYPE_NAME_EDEFAULT == null ? getDataTypeName() != null : !DATA_TYPE_NAME_EDEFAULT.equals(getDataTypeName());
case DomPackage.ATTRIBUTE__RESOLVED_ATTRIBUTE_LIST:
return !getResolvedAttributeList().isEmpty();
case DomPackage.ATTRIBUTE__REFERENCE:
return isReference() != REFERENCE_EDEFAULT;
case DomPackage.ATTRIBUTE__READ_ONLY:
return isReadOnly() != READ_ONLY_EDEFAULT;
case DomPackage.ATTRIBUTE__REQUIRED:
return isRequired() != REQUIRED_EDEFAULT;
case DomPackage.ATTRIBUTE__DERIVED:
return isDerived() != DERIVED_EDEFAULT;
case DomPackage.ATTRIBUTE__TRANSIENT:
return isTransient() != TRANSIENT_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
*
* @generated
*/
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) {
if (baseClass == QueryParameterReference.class) {
switch (derivedFeatureID) {
default: return -1;
}
}
if (baseClass == PresentableFeature.class) {
switch (derivedFeatureID) {
case DomPackage.ATTRIBUTE__NAME: return DomPackage.PRESENTABLE_FEATURE__NAME;
default: return -1;
}
}
if (baseClass == IDocumentable.class) {
switch (derivedFeatureID) {
case DomPackage.ATTRIBUTE__TXT_DESCRIPTION: return CorePackage.IDOCUMENTABLE__TXT_DESCRIPTION;
default: return -1;
}
}
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
/**
*
* @generated
*/
@Override
public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) {
if (baseClass == QueryParameterReference.class) {
switch (baseFeatureID) {
default: return -1;
}
}
if (baseClass == PresentableFeature.class) {
switch (baseFeatureID) {
case DomPackage.PRESENTABLE_FEATURE__NAME: return DomPackage.ATTRIBUTE__NAME;
default: return -1;
}
}
if (baseClass == IDocumentable.class) {
switch (baseFeatureID) {
case CorePackage.IDOCUMENTABLE__TXT_DESCRIPTION: return DomPackage.ATTRIBUTE__TXT_DESCRIPTION;
default: return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
/**
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
result.append(name);
result.append(", txtDescription: ");
result.append(txtDescription);
result.append(", identifier: ");
result.append(identifier);
result.append(", version: ");
result.append(version);
result.append(", composition: ");
result.append(composition);
result.append(", many: ");
result.append(many);
result.append(", defaultValue: ");
result.append(defaultValue);
result.append(')');
return result.toString();
}
/**
* @modified
* @return the label text for the field
*/
public String getLabelText() {
EList attrProp = getAttributProperties();
if (attrProp != null && attrProp.size() > 0) {
return AttributePropertyImpl.getLabelText(getAttributProperties());
}
return null;
}
/**
* @modified
* @return the hstore column name for the field
*/
public String getHstoreColumn() {
EList attrProp = getAttributProperties();
if (attrProp != null && attrProp.size() > 0) {
return AttributePropertyImpl.getHstoreColumn(getAttributProperties());
}
return null;
}
/**
* @modified
* @return true if the hstore column name has been specified
*/
public boolean isHstore() {
return getHstoreColumn() != null;
}
/**
* @modified
* @return the label text for the field
*/
public String getTooltipText() {
EList attrProp = getAttributProperties();
if (attrProp != null && attrProp.size() > 0) {
return AttributePropertyImpl.getTooltipText(getAttributProperties());
}
return null;
}
/**
* @modified
* @return the unit text for the field
*/
public String getUnitText() {
EList attrProp = getAttributProperties();
if (attrProp != null && attrProp.size() > 0) {
return AttributePropertyImpl.getUnitText(getAttributProperties());
}
return null;
}
/**
* @modified
* @return the unit attribute for the attribute
*/
public Attribute getUnitAttribute() {
EList attrProp = getAttributProperties();
if (attrProp != null && attrProp.size() > 0) {
return AttributePropertyImpl.getUnitAttribute(getAttributProperties());
}
return null;
}
/**
* @modified
* @return the attribute
*/
public Attribute getAttribute() {
return this;
}
/**
* @modified
*/
public boolean isOptional() {
return !isRequired();
}
/**
* @modified
*/
public boolean isOne() {
return !isMany();
}
/**
* @modified
* @return the attribute
*/
public String getCalculatedName() {
return getName();
}
/**
* @modified
*/
public ValidatorReference getFormat() {
return getFormatInternal(getAttributProperties());
}
/**
* @modified
*/
public static ValidatorReference getFormatInternal(EList attributProperties) {
for (AttributeProperty p : attributProperties) {
if (p instanceof AttributeValidationProperty) {
AttributeValidationProperty avp = (AttributeValidationProperty)p;
return avp.getFormat();
}
}
return null;
}
private String originalName;
public void setOriginalName(String originalName) {
this.originalName = originalName;
}
public String getOriginalName() {
return originalName;
}
private String originalContainerName;
public void setOriginalContainerName(String originalContainerName) {
this.originalContainerName = originalContainerName;
}
public String getOriginalContainerName() {
return originalContainerName;
}
} // AttributeImpl