
jbase.jbase.impl.XJClassObjectImpl Maven / Gradle / Ivy
/**
*/
package jbase.jbase.impl;
import java.util.Collection;
import jbase.jbase.JbasePackage;
import jbase.jbase.XJClassObject;
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.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
import org.eclipse.xtext.xbase.XExpression;
import org.eclipse.xtext.xbase.impl.XExpressionImpl;
/**
*
* An implementation of the model object 'XJ Class Object'.
*
*
* The following features are implemented:
*
*
* - {@link jbase.jbase.impl.XJClassObjectImpl#getTypeExpression Type Expression}
* - {@link jbase.jbase.impl.XJClassObjectImpl#getArrayDimensions Array Dimensions}
*
*
* @generated
*/
public class XJClassObjectImpl extends XExpressionImpl implements XJClassObject
{
/**
* The cached value of the '{@link #getTypeExpression() Type Expression}' containment reference.
*
*
* @see #getTypeExpression()
* @generated
* @ordered
*/
protected XExpression typeExpression;
/**
* The cached value of the '{@link #getArrayDimensions() Array Dimensions}' attribute list.
*
*
* @see #getArrayDimensions()
* @generated
* @ordered
*/
protected EList arrayDimensions;
/**
*
*
* @generated
*/
protected XJClassObjectImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return JbasePackage.Literals.XJ_CLASS_OBJECT;
}
/**
*
*
* @generated
*/
public XExpression getTypeExpression()
{
return typeExpression;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetTypeExpression(XExpression newTypeExpression, NotificationChain msgs)
{
XExpression oldTypeExpression = typeExpression;
typeExpression = newTypeExpression;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JbasePackage.XJ_CLASS_OBJECT__TYPE_EXPRESSION, oldTypeExpression, newTypeExpression);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setTypeExpression(XExpression newTypeExpression)
{
if (newTypeExpression != typeExpression)
{
NotificationChain msgs = null;
if (typeExpression != null)
msgs = ((InternalEObject)typeExpression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JbasePackage.XJ_CLASS_OBJECT__TYPE_EXPRESSION, null, msgs);
if (newTypeExpression != null)
msgs = ((InternalEObject)newTypeExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JbasePackage.XJ_CLASS_OBJECT__TYPE_EXPRESSION, null, msgs);
msgs = basicSetTypeExpression(newTypeExpression, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, JbasePackage.XJ_CLASS_OBJECT__TYPE_EXPRESSION, newTypeExpression, newTypeExpression));
}
/**
*
*
* @generated
*/
public EList getArrayDimensions()
{
if (arrayDimensions == null)
{
arrayDimensions = new EDataTypeUniqueEList(String.class, this, JbasePackage.XJ_CLASS_OBJECT__ARRAY_DIMENSIONS);
}
return arrayDimensions;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case JbasePackage.XJ_CLASS_OBJECT__TYPE_EXPRESSION:
return basicSetTypeExpression(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case JbasePackage.XJ_CLASS_OBJECT__TYPE_EXPRESSION:
return getTypeExpression();
case JbasePackage.XJ_CLASS_OBJECT__ARRAY_DIMENSIONS:
return getArrayDimensions();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case JbasePackage.XJ_CLASS_OBJECT__TYPE_EXPRESSION:
setTypeExpression((XExpression)newValue);
return;
case JbasePackage.XJ_CLASS_OBJECT__ARRAY_DIMENSIONS:
getArrayDimensions().clear();
getArrayDimensions().addAll((Collection extends String>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case JbasePackage.XJ_CLASS_OBJECT__TYPE_EXPRESSION:
setTypeExpression((XExpression)null);
return;
case JbasePackage.XJ_CLASS_OBJECT__ARRAY_DIMENSIONS:
getArrayDimensions().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case JbasePackage.XJ_CLASS_OBJECT__TYPE_EXPRESSION:
return typeExpression != null;
case JbasePackage.XJ_CLASS_OBJECT__ARRAY_DIMENSIONS:
return arrayDimensions != null && !arrayDimensions.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (arrayDimensions: ");
result.append(arrayDimensions);
result.append(')');
return result.toString();
}
} //XJClassObjectImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy