org.openxma.dsl.dom.model.impl.FromClassImpl Maven / Gradle / Ivy
/**
*
*
*
* $Id$
*/
package org.openxma.dsl.dom.model.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.openxma.dsl.dom.DomPackage;
import org.openxma.dsl.dom.model.Entity;
import org.openxma.dsl.dom.model.FromClass;
import org.openxma.dsl.dom.model.JoinEntity;
/**
*
* An implementation of the model object 'From Class'.
*
*
* The following features are implemented:
*
* - {@link org.openxma.dsl.dom.model.impl.FromClassImpl#getName Name}
* - {@link org.openxma.dsl.dom.model.impl.FromClassImpl#getEntity Entity}
* - {@link org.openxma.dsl.dom.model.impl.FromClassImpl#isPopertyFetch Poperty Fetch}
*
*
*
* @generated
*/
public class FromClassImpl extends FromRangeImpl implements FromClass {
/**
* 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 cached value of the '{@link #getEntity() Entity}' reference.
*
*
* @see #getEntity()
* @generated
* @ordered
*/
protected Entity entity;
/**
* The default value of the '{@link #isPopertyFetch() Poperty Fetch}' attribute.
*
*
* @see #isPopertyFetch()
* @generated
* @ordered
*/
protected static final boolean POPERTY_FETCH_EDEFAULT = false;
/**
* The cached value of the '{@link #isPopertyFetch() Poperty Fetch}' attribute.
*
*
* @see #isPopertyFetch()
* @generated
* @ordered
*/
protected boolean popertyFetch = POPERTY_FETCH_EDEFAULT;
/**
*
*
* @generated
*/
protected FromClassImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return DomPackage.Literals.FROM_CLASS;
}
/**
*
*
* @generated
*/
public Entity getEntity() {
if (entity != null && entity.eIsProxy()) {
InternalEObject oldEntity = (InternalEObject)entity;
entity = (Entity)eResolveProxy(oldEntity);
if (entity != oldEntity) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, DomPackage.FROM_CLASS__ENTITY, oldEntity, entity));
}
}
return entity;
}
/**
*
*
* @generated
*/
public Entity basicGetEntity() {
return entity;
}
/**
*
*
* @generated
*/
public void setEntity(Entity newEntity) {
Entity oldEntity = entity;
entity = newEntity;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.FROM_CLASS__ENTITY, oldEntity, entity));
}
/**
*
*
* @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.FROM_CLASS__NAME, oldName, name));
}
/**
*
*
* @generated
*/
public boolean isPopertyFetch() {
return popertyFetch;
}
/**
*
*
* @generated
*/
public void setPopertyFetch(boolean newPopertyFetch) {
boolean oldPopertyFetch = popertyFetch;
popertyFetch = newPopertyFetch;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.FROM_CLASS__POPERTY_FETCH, oldPopertyFetch, popertyFetch));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DomPackage.FROM_CLASS__NAME:
return getName();
case DomPackage.FROM_CLASS__ENTITY:
if (resolve) return getEntity();
return basicGetEntity();
case DomPackage.FROM_CLASS__POPERTY_FETCH:
return isPopertyFetch();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DomPackage.FROM_CLASS__NAME:
setName((String)newValue);
return;
case DomPackage.FROM_CLASS__ENTITY:
setEntity((Entity)newValue);
return;
case DomPackage.FROM_CLASS__POPERTY_FETCH:
setPopertyFetch((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DomPackage.FROM_CLASS__NAME:
setName(NAME_EDEFAULT);
return;
case DomPackage.FROM_CLASS__ENTITY:
setEntity((Entity)null);
return;
case DomPackage.FROM_CLASS__POPERTY_FETCH:
setPopertyFetch(POPERTY_FETCH_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DomPackage.FROM_CLASS__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case DomPackage.FROM_CLASS__ENTITY:
return entity != null;
case DomPackage.FROM_CLASS__POPERTY_FETCH:
return popertyFetch != POPERTY_FETCH_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class> baseClass) {
if (baseClass == JoinEntity.class) {
switch (derivedFeatureID) {
case DomPackage.FROM_CLASS__NAME: return DomPackage.JOIN_ENTITY__NAME;
default: return -1;
}
}
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
/**
*
*
* @generated
*/
@Override
public int eDerivedStructuralFeatureID(int baseFeatureID, Class> baseClass) {
if (baseClass == JoinEntity.class) {
switch (baseFeatureID) {
case DomPackage.JOIN_ENTITY__NAME: return DomPackage.FROM_CLASS__NAME;
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(", popertyFetch: ");
result.append(popertyFetch);
result.append(')');
return result.toString();
}
} //FromClassImpl