org.contextmapper.tactic.dsl.tacticdsl.impl.ReferenceImpl Maven / Gradle / Ivy
/**
* generated by Xtext 2.21.0
*/
package org.contextmapper.tactic.dsl.tacticdsl.impl;
import org.contextmapper.tactic.dsl.tacticdsl.OppositeHolder;
import org.contextmapper.tactic.dsl.tacticdsl.Reference;
import org.contextmapper.tactic.dsl.tacticdsl.SimpleDomainObject;
import org.contextmapper.tactic.dsl.tacticdsl.TacticdslPackage;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
*
* An implementation of the model object 'Reference'.
*
*
* The following features are implemented:
*
*
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ReferenceImpl#getDomainObjectType Domain Object Type}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ReferenceImpl#getCascade Cascade}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ReferenceImpl#getFetch Fetch}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ReferenceImpl#isCache Cache}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ReferenceImpl#isInverse Inverse}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ReferenceImpl#getDatabaseJoinTable Database Join Table}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ReferenceImpl#getDatabaseJoinColumn Database Join Column}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ReferenceImpl#isValid Valid}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ReferenceImpl#getValidMessage Valid Message}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ReferenceImpl#getOrderBy Order By}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ReferenceImpl#isOrderColumn Order Column}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ReferenceImpl#getOrderColumnName Order Column Name}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ReferenceImpl#getOppositeHolder Opposite Holder}
*
*
* @generated
*/
public class ReferenceImpl extends PropertyImpl implements Reference
{
/**
* The cached value of the '{@link #getDomainObjectType() Domain Object Type}' reference.
*
*
* @see #getDomainObjectType()
* @generated
* @ordered
*/
protected SimpleDomainObject domainObjectType;
/**
* The default value of the '{@link #getCascade() Cascade}' attribute.
*
*
* @see #getCascade()
* @generated
* @ordered
*/
protected static final String CASCADE_EDEFAULT = null;
/**
* The cached value of the '{@link #getCascade() Cascade}' attribute.
*
*
* @see #getCascade()
* @generated
* @ordered
*/
protected String cascade = CASCADE_EDEFAULT;
/**
* The default value of the '{@link #getFetch() Fetch}' attribute.
*
*
* @see #getFetch()
* @generated
* @ordered
*/
protected static final String FETCH_EDEFAULT = null;
/**
* The cached value of the '{@link #getFetch() Fetch}' attribute.
*
*
* @see #getFetch()
* @generated
* @ordered
*/
protected String fetch = FETCH_EDEFAULT;
/**
* The default value of the '{@link #isCache() Cache}' attribute.
*
*
* @see #isCache()
* @generated
* @ordered
*/
protected static final boolean CACHE_EDEFAULT = false;
/**
* The cached value of the '{@link #isCache() Cache}' attribute.
*
*
* @see #isCache()
* @generated
* @ordered
*/
protected boolean cache = CACHE_EDEFAULT;
/**
* The default value of the '{@link #isInverse() Inverse}' attribute.
*
*
* @see #isInverse()
* @generated
* @ordered
*/
protected static final boolean INVERSE_EDEFAULT = false;
/**
* The cached value of the '{@link #isInverse() Inverse}' attribute.
*
*
* @see #isInverse()
* @generated
* @ordered
*/
protected boolean inverse = INVERSE_EDEFAULT;
/**
* The default value of the '{@link #getDatabaseJoinTable() Database Join Table}' attribute.
*
*
* @see #getDatabaseJoinTable()
* @generated
* @ordered
*/
protected static final String DATABASE_JOIN_TABLE_EDEFAULT = null;
/**
* The cached value of the '{@link #getDatabaseJoinTable() Database Join Table}' attribute.
*
*
* @see #getDatabaseJoinTable()
* @generated
* @ordered
*/
protected String databaseJoinTable = DATABASE_JOIN_TABLE_EDEFAULT;
/**
* The default value of the '{@link #getDatabaseJoinColumn() Database Join Column}' attribute.
*
*
* @see #getDatabaseJoinColumn()
* @generated
* @ordered
*/
protected static final String DATABASE_JOIN_COLUMN_EDEFAULT = null;
/**
* The cached value of the '{@link #getDatabaseJoinColumn() Database Join Column}' attribute.
*
*
* @see #getDatabaseJoinColumn()
* @generated
* @ordered
*/
protected String databaseJoinColumn = DATABASE_JOIN_COLUMN_EDEFAULT;
/**
* The default value of the '{@link #isValid() Valid}' attribute.
*
*
* @see #isValid()
* @generated
* @ordered
*/
protected static final boolean VALID_EDEFAULT = false;
/**
* The cached value of the '{@link #isValid() Valid}' attribute.
*
*
* @see #isValid()
* @generated
* @ordered
*/
protected boolean valid = VALID_EDEFAULT;
/**
* The default value of the '{@link #getValidMessage() Valid Message}' attribute.
*
*
* @see #getValidMessage()
* @generated
* @ordered
*/
protected static final String VALID_MESSAGE_EDEFAULT = null;
/**
* The cached value of the '{@link #getValidMessage() Valid Message}' attribute.
*
*
* @see #getValidMessage()
* @generated
* @ordered
*/
protected String validMessage = VALID_MESSAGE_EDEFAULT;
/**
* The default value of the '{@link #getOrderBy() Order By}' attribute.
*
*
* @see #getOrderBy()
* @generated
* @ordered
*/
protected static final String ORDER_BY_EDEFAULT = null;
/**
* The cached value of the '{@link #getOrderBy() Order By}' attribute.
*
*
* @see #getOrderBy()
* @generated
* @ordered
*/
protected String orderBy = ORDER_BY_EDEFAULT;
/**
* The default value of the '{@link #isOrderColumn() Order Column}' attribute.
*
*
* @see #isOrderColumn()
* @generated
* @ordered
*/
protected static final boolean ORDER_COLUMN_EDEFAULT = false;
/**
* The cached value of the '{@link #isOrderColumn() Order Column}' attribute.
*
*
* @see #isOrderColumn()
* @generated
* @ordered
*/
protected boolean orderColumn = ORDER_COLUMN_EDEFAULT;
/**
* The default value of the '{@link #getOrderColumnName() Order Column Name}' attribute.
*
*
* @see #getOrderColumnName()
* @generated
* @ordered
*/
protected static final String ORDER_COLUMN_NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getOrderColumnName() Order Column Name}' attribute.
*
*
* @see #getOrderColumnName()
* @generated
* @ordered
*/
protected String orderColumnName = ORDER_COLUMN_NAME_EDEFAULT;
/**
* The cached value of the '{@link #getOppositeHolder() Opposite Holder}' containment reference.
*
*
* @see #getOppositeHolder()
* @generated
* @ordered
*/
protected OppositeHolder oppositeHolder;
/**
*
*
* @generated
*/
protected ReferenceImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return TacticdslPackage.Literals.REFERENCE;
}
/**
*
*
* @generated
*/
@Override
public SimpleDomainObject getDomainObjectType()
{
if (domainObjectType != null && domainObjectType.eIsProxy())
{
InternalEObject oldDomainObjectType = (InternalEObject)domainObjectType;
domainObjectType = (SimpleDomainObject)eResolveProxy(oldDomainObjectType);
if (domainObjectType != oldDomainObjectType)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, TacticdslPackage.REFERENCE__DOMAIN_OBJECT_TYPE, oldDomainObjectType, domainObjectType));
}
}
return domainObjectType;
}
/**
*
*
* @generated
*/
public SimpleDomainObject basicGetDomainObjectType()
{
return domainObjectType;
}
/**
*
*
* @generated
*/
@Override
public void setDomainObjectType(SimpleDomainObject newDomainObjectType)
{
SimpleDomainObject oldDomainObjectType = domainObjectType;
domainObjectType = newDomainObjectType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.REFERENCE__DOMAIN_OBJECT_TYPE, oldDomainObjectType, domainObjectType));
}
/**
*
*
* @generated
*/
@Override
public String getCascade()
{
return cascade;
}
/**
*
*
* @generated
*/
@Override
public void setCascade(String newCascade)
{
String oldCascade = cascade;
cascade = newCascade;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.REFERENCE__CASCADE, oldCascade, cascade));
}
/**
*
*
* @generated
*/
@Override
public String getFetch()
{
return fetch;
}
/**
*
*
* @generated
*/
@Override
public void setFetch(String newFetch)
{
String oldFetch = fetch;
fetch = newFetch;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.REFERENCE__FETCH, oldFetch, fetch));
}
/**
*
*
* @generated
*/
@Override
public boolean isCache()
{
return cache;
}
/**
*
*
* @generated
*/
@Override
public void setCache(boolean newCache)
{
boolean oldCache = cache;
cache = newCache;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.REFERENCE__CACHE, oldCache, cache));
}
/**
*
*
* @generated
*/
@Override
public boolean isInverse()
{
return inverse;
}
/**
*
*
* @generated
*/
@Override
public void setInverse(boolean newInverse)
{
boolean oldInverse = inverse;
inverse = newInverse;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.REFERENCE__INVERSE, oldInverse, inverse));
}
/**
*
*
* @generated
*/
@Override
public String getDatabaseJoinTable()
{
return databaseJoinTable;
}
/**
*
*
* @generated
*/
@Override
public void setDatabaseJoinTable(String newDatabaseJoinTable)
{
String oldDatabaseJoinTable = databaseJoinTable;
databaseJoinTable = newDatabaseJoinTable;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.REFERENCE__DATABASE_JOIN_TABLE, oldDatabaseJoinTable, databaseJoinTable));
}
/**
*
*
* @generated
*/
@Override
public String getDatabaseJoinColumn()
{
return databaseJoinColumn;
}
/**
*
*
* @generated
*/
@Override
public void setDatabaseJoinColumn(String newDatabaseJoinColumn)
{
String oldDatabaseJoinColumn = databaseJoinColumn;
databaseJoinColumn = newDatabaseJoinColumn;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.REFERENCE__DATABASE_JOIN_COLUMN, oldDatabaseJoinColumn, databaseJoinColumn));
}
/**
*
*
* @generated
*/
@Override
public boolean isValid()
{
return valid;
}
/**
*
*
* @generated
*/
@Override
public void setValid(boolean newValid)
{
boolean oldValid = valid;
valid = newValid;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.REFERENCE__VALID, oldValid, valid));
}
/**
*
*
* @generated
*/
@Override
public String getValidMessage()
{
return validMessage;
}
/**
*
*
* @generated
*/
@Override
public void setValidMessage(String newValidMessage)
{
String oldValidMessage = validMessage;
validMessage = newValidMessage;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.REFERENCE__VALID_MESSAGE, oldValidMessage, validMessage));
}
/**
*
*
* @generated
*/
@Override
public String getOrderBy()
{
return orderBy;
}
/**
*
*
* @generated
*/
@Override
public void setOrderBy(String newOrderBy)
{
String oldOrderBy = orderBy;
orderBy = newOrderBy;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.REFERENCE__ORDER_BY, oldOrderBy, orderBy));
}
/**
*
*
* @generated
*/
@Override
public boolean isOrderColumn()
{
return orderColumn;
}
/**
*
*
* @generated
*/
@Override
public void setOrderColumn(boolean newOrderColumn)
{
boolean oldOrderColumn = orderColumn;
orderColumn = newOrderColumn;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.REFERENCE__ORDER_COLUMN, oldOrderColumn, orderColumn));
}
/**
*
*
* @generated
*/
@Override
public String getOrderColumnName()
{
return orderColumnName;
}
/**
*
*
* @generated
*/
@Override
public void setOrderColumnName(String newOrderColumnName)
{
String oldOrderColumnName = orderColumnName;
orderColumnName = newOrderColumnName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.REFERENCE__ORDER_COLUMN_NAME, oldOrderColumnName, orderColumnName));
}
/**
*
*
* @generated
*/
@Override
public OppositeHolder getOppositeHolder()
{
return oppositeHolder;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetOppositeHolder(OppositeHolder newOppositeHolder, NotificationChain msgs)
{
OppositeHolder oldOppositeHolder = oppositeHolder;
oppositeHolder = newOppositeHolder;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TacticdslPackage.REFERENCE__OPPOSITE_HOLDER, oldOppositeHolder, newOppositeHolder);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setOppositeHolder(OppositeHolder newOppositeHolder)
{
if (newOppositeHolder != oppositeHolder)
{
NotificationChain msgs = null;
if (oppositeHolder != null)
msgs = ((InternalEObject)oppositeHolder).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TacticdslPackage.REFERENCE__OPPOSITE_HOLDER, null, msgs);
if (newOppositeHolder != null)
msgs = ((InternalEObject)newOppositeHolder).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TacticdslPackage.REFERENCE__OPPOSITE_HOLDER, null, msgs);
msgs = basicSetOppositeHolder(newOppositeHolder, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.REFERENCE__OPPOSITE_HOLDER, newOppositeHolder, newOppositeHolder));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case TacticdslPackage.REFERENCE__OPPOSITE_HOLDER:
return basicSetOppositeHolder(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case TacticdslPackage.REFERENCE__DOMAIN_OBJECT_TYPE:
if (resolve) return getDomainObjectType();
return basicGetDomainObjectType();
case TacticdslPackage.REFERENCE__CASCADE:
return getCascade();
case TacticdslPackage.REFERENCE__FETCH:
return getFetch();
case TacticdslPackage.REFERENCE__CACHE:
return isCache();
case TacticdslPackage.REFERENCE__INVERSE:
return isInverse();
case TacticdslPackage.REFERENCE__DATABASE_JOIN_TABLE:
return getDatabaseJoinTable();
case TacticdslPackage.REFERENCE__DATABASE_JOIN_COLUMN:
return getDatabaseJoinColumn();
case TacticdslPackage.REFERENCE__VALID:
return isValid();
case TacticdslPackage.REFERENCE__VALID_MESSAGE:
return getValidMessage();
case TacticdslPackage.REFERENCE__ORDER_BY:
return getOrderBy();
case TacticdslPackage.REFERENCE__ORDER_COLUMN:
return isOrderColumn();
case TacticdslPackage.REFERENCE__ORDER_COLUMN_NAME:
return getOrderColumnName();
case TacticdslPackage.REFERENCE__OPPOSITE_HOLDER:
return getOppositeHolder();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case TacticdslPackage.REFERENCE__DOMAIN_OBJECT_TYPE:
setDomainObjectType((SimpleDomainObject)newValue);
return;
case TacticdslPackage.REFERENCE__CASCADE:
setCascade((String)newValue);
return;
case TacticdslPackage.REFERENCE__FETCH:
setFetch((String)newValue);
return;
case TacticdslPackage.REFERENCE__CACHE:
setCache((Boolean)newValue);
return;
case TacticdslPackage.REFERENCE__INVERSE:
setInverse((Boolean)newValue);
return;
case TacticdslPackage.REFERENCE__DATABASE_JOIN_TABLE:
setDatabaseJoinTable((String)newValue);
return;
case TacticdslPackage.REFERENCE__DATABASE_JOIN_COLUMN:
setDatabaseJoinColumn((String)newValue);
return;
case TacticdslPackage.REFERENCE__VALID:
setValid((Boolean)newValue);
return;
case TacticdslPackage.REFERENCE__VALID_MESSAGE:
setValidMessage((String)newValue);
return;
case TacticdslPackage.REFERENCE__ORDER_BY:
setOrderBy((String)newValue);
return;
case TacticdslPackage.REFERENCE__ORDER_COLUMN:
setOrderColumn((Boolean)newValue);
return;
case TacticdslPackage.REFERENCE__ORDER_COLUMN_NAME:
setOrderColumnName((String)newValue);
return;
case TacticdslPackage.REFERENCE__OPPOSITE_HOLDER:
setOppositeHolder((OppositeHolder)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case TacticdslPackage.REFERENCE__DOMAIN_OBJECT_TYPE:
setDomainObjectType((SimpleDomainObject)null);
return;
case TacticdslPackage.REFERENCE__CASCADE:
setCascade(CASCADE_EDEFAULT);
return;
case TacticdslPackage.REFERENCE__FETCH:
setFetch(FETCH_EDEFAULT);
return;
case TacticdslPackage.REFERENCE__CACHE:
setCache(CACHE_EDEFAULT);
return;
case TacticdslPackage.REFERENCE__INVERSE:
setInverse(INVERSE_EDEFAULT);
return;
case TacticdslPackage.REFERENCE__DATABASE_JOIN_TABLE:
setDatabaseJoinTable(DATABASE_JOIN_TABLE_EDEFAULT);
return;
case TacticdslPackage.REFERENCE__DATABASE_JOIN_COLUMN:
setDatabaseJoinColumn(DATABASE_JOIN_COLUMN_EDEFAULT);
return;
case TacticdslPackage.REFERENCE__VALID:
setValid(VALID_EDEFAULT);
return;
case TacticdslPackage.REFERENCE__VALID_MESSAGE:
setValidMessage(VALID_MESSAGE_EDEFAULT);
return;
case TacticdslPackage.REFERENCE__ORDER_BY:
setOrderBy(ORDER_BY_EDEFAULT);
return;
case TacticdslPackage.REFERENCE__ORDER_COLUMN:
setOrderColumn(ORDER_COLUMN_EDEFAULT);
return;
case TacticdslPackage.REFERENCE__ORDER_COLUMN_NAME:
setOrderColumnName(ORDER_COLUMN_NAME_EDEFAULT);
return;
case TacticdslPackage.REFERENCE__OPPOSITE_HOLDER:
setOppositeHolder((OppositeHolder)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case TacticdslPackage.REFERENCE__DOMAIN_OBJECT_TYPE:
return domainObjectType != null;
case TacticdslPackage.REFERENCE__CASCADE:
return CASCADE_EDEFAULT == null ? cascade != null : !CASCADE_EDEFAULT.equals(cascade);
case TacticdslPackage.REFERENCE__FETCH:
return FETCH_EDEFAULT == null ? fetch != null : !FETCH_EDEFAULT.equals(fetch);
case TacticdslPackage.REFERENCE__CACHE:
return cache != CACHE_EDEFAULT;
case TacticdslPackage.REFERENCE__INVERSE:
return inverse != INVERSE_EDEFAULT;
case TacticdslPackage.REFERENCE__DATABASE_JOIN_TABLE:
return DATABASE_JOIN_TABLE_EDEFAULT == null ? databaseJoinTable != null : !DATABASE_JOIN_TABLE_EDEFAULT.equals(databaseJoinTable);
case TacticdslPackage.REFERENCE__DATABASE_JOIN_COLUMN:
return DATABASE_JOIN_COLUMN_EDEFAULT == null ? databaseJoinColumn != null : !DATABASE_JOIN_COLUMN_EDEFAULT.equals(databaseJoinColumn);
case TacticdslPackage.REFERENCE__VALID:
return valid != VALID_EDEFAULT;
case TacticdslPackage.REFERENCE__VALID_MESSAGE:
return VALID_MESSAGE_EDEFAULT == null ? validMessage != null : !VALID_MESSAGE_EDEFAULT.equals(validMessage);
case TacticdslPackage.REFERENCE__ORDER_BY:
return ORDER_BY_EDEFAULT == null ? orderBy != null : !ORDER_BY_EDEFAULT.equals(orderBy);
case TacticdslPackage.REFERENCE__ORDER_COLUMN:
return orderColumn != ORDER_COLUMN_EDEFAULT;
case TacticdslPackage.REFERENCE__ORDER_COLUMN_NAME:
return ORDER_COLUMN_NAME_EDEFAULT == null ? orderColumnName != null : !ORDER_COLUMN_NAME_EDEFAULT.equals(orderColumnName);
case TacticdslPackage.REFERENCE__OPPOSITE_HOLDER:
return oppositeHolder != null;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (cascade: ");
result.append(cascade);
result.append(", fetch: ");
result.append(fetch);
result.append(", cache: ");
result.append(cache);
result.append(", inverse: ");
result.append(inverse);
result.append(", databaseJoinTable: ");
result.append(databaseJoinTable);
result.append(", databaseJoinColumn: ");
result.append(databaseJoinColumn);
result.append(", valid: ");
result.append(valid);
result.append(", validMessage: ");
result.append(validMessage);
result.append(", orderBy: ");
result.append(orderBy);
result.append(", orderColumn: ");
result.append(orderColumn);
result.append(", orderColumnName: ");
result.append(orderColumnName);
result.append(')');
return result.toString();
}
} //ReferenceImpl