org.contextmapper.tactic.dsl.tacticdsl.impl.DomainObjectOperationImpl Maven / Gradle / Ivy
/**
* generated by Xtext 2.21.0
*/
package org.contextmapper.tactic.dsl.tacticdsl.impl;
import java.util.Collection;
import org.contextmapper.tactic.dsl.tacticdsl.ComplexType;
import org.contextmapper.tactic.dsl.tacticdsl.DomainObjectOperation;
import org.contextmapper.tactic.dsl.tacticdsl.Parameter;
import org.contextmapper.tactic.dsl.tacticdsl.TacticdslPackage;
import org.contextmapper.tactic.dsl.tacticdsl.Visibility;
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.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Domain Object Operation'.
*
*
* The following features are implemented:
*
*
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.DomainObjectOperationImpl#getDoc Doc}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.DomainObjectOperationImpl#isAbstract Abstract}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.DomainObjectOperationImpl#getVisibility Visibility}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.DomainObjectOperationImpl#getReturnType Return Type}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.DomainObjectOperationImpl#getName Name}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.DomainObjectOperationImpl#getParameters Parameters}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.DomainObjectOperationImpl#getThrows Throws}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.DomainObjectOperationImpl#getHint Hint}
*
*
* @generated
*/
public class DomainObjectOperationImpl extends DomainObjectTypedElementImpl implements DomainObjectOperation
{
/**
* The default value of the '{@link #getDoc() Doc}' attribute.
*
*
* @see #getDoc()
* @generated
* @ordered
*/
protected static final String DOC_EDEFAULT = null;
/**
* The cached value of the '{@link #getDoc() Doc}' attribute.
*
*
* @see #getDoc()
* @generated
* @ordered
*/
protected String doc = DOC_EDEFAULT;
/**
* The default value of the '{@link #isAbstract() Abstract}' attribute.
*
*
* @see #isAbstract()
* @generated
* @ordered
*/
protected static final boolean ABSTRACT_EDEFAULT = false;
/**
* The cached value of the '{@link #isAbstract() Abstract}' attribute.
*
*
* @see #isAbstract()
* @generated
* @ordered
*/
protected boolean abstract_ = ABSTRACT_EDEFAULT;
/**
* The default value of the '{@link #getVisibility() Visibility}' attribute.
*
*
* @see #getVisibility()
* @generated
* @ordered
*/
protected static final Visibility VISIBILITY_EDEFAULT = Visibility.PUBLIC;
/**
* The cached value of the '{@link #getVisibility() Visibility}' attribute.
*
*
* @see #getVisibility()
* @generated
* @ordered
*/
protected Visibility visibility = VISIBILITY_EDEFAULT;
/**
* The cached value of the '{@link #getReturnType() Return Type}' containment reference.
*
*
* @see #getReturnType()
* @generated
* @ordered
*/
protected ComplexType returnType;
/**
* 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 #getParameters() Parameters}' containment reference list.
*
*
* @see #getParameters()
* @generated
* @ordered
*/
protected EList parameters;
/**
* The default value of the '{@link #getThrows() Throws}' attribute.
*
*
* @see #getThrows()
* @generated
* @ordered
*/
protected static final String THROWS_EDEFAULT = null;
/**
* The cached value of the '{@link #getThrows() Throws}' attribute.
*
*
* @see #getThrows()
* @generated
* @ordered
*/
protected String throws_ = THROWS_EDEFAULT;
/**
* The default value of the '{@link #getHint() Hint}' attribute.
*
*
* @see #getHint()
* @generated
* @ordered
*/
protected static final String HINT_EDEFAULT = null;
/**
* The cached value of the '{@link #getHint() Hint}' attribute.
*
*
* @see #getHint()
* @generated
* @ordered
*/
protected String hint = HINT_EDEFAULT;
/**
*
*
* @generated
*/
protected DomainObjectOperationImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return TacticdslPackage.Literals.DOMAIN_OBJECT_OPERATION;
}
/**
*
*
* @generated
*/
@Override
public String getDoc()
{
return doc;
}
/**
*
*
* @generated
*/
@Override
public void setDoc(String newDoc)
{
String oldDoc = doc;
doc = newDoc;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.DOMAIN_OBJECT_OPERATION__DOC, oldDoc, doc));
}
/**
*
*
* @generated
*/
@Override
public boolean isAbstract()
{
return abstract_;
}
/**
*
*
* @generated
*/
@Override
public void setAbstract(boolean newAbstract)
{
boolean oldAbstract = abstract_;
abstract_ = newAbstract;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.DOMAIN_OBJECT_OPERATION__ABSTRACT, oldAbstract, abstract_));
}
/**
*
*
* @generated
*/
@Override
public Visibility getVisibility()
{
return visibility;
}
/**
*
*
* @generated
*/
@Override
public void setVisibility(Visibility newVisibility)
{
Visibility oldVisibility = visibility;
visibility = newVisibility == null ? VISIBILITY_EDEFAULT : newVisibility;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.DOMAIN_OBJECT_OPERATION__VISIBILITY, oldVisibility, visibility));
}
/**
*
*
* @generated
*/
@Override
public ComplexType getReturnType()
{
return returnType;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetReturnType(ComplexType newReturnType, NotificationChain msgs)
{
ComplexType oldReturnType = returnType;
returnType = newReturnType;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TacticdslPackage.DOMAIN_OBJECT_OPERATION__RETURN_TYPE, oldReturnType, newReturnType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setReturnType(ComplexType newReturnType)
{
if (newReturnType != returnType)
{
NotificationChain msgs = null;
if (returnType != null)
msgs = ((InternalEObject)returnType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TacticdslPackage.DOMAIN_OBJECT_OPERATION__RETURN_TYPE, null, msgs);
if (newReturnType != null)
msgs = ((InternalEObject)newReturnType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TacticdslPackage.DOMAIN_OBJECT_OPERATION__RETURN_TYPE, null, msgs);
msgs = basicSetReturnType(newReturnType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.DOMAIN_OBJECT_OPERATION__RETURN_TYPE, newReturnType, newReturnType));
}
/**
*
*
* @generated
*/
@Override
public String getName()
{
return name;
}
/**
*
*
* @generated
*/
@Override
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.DOMAIN_OBJECT_OPERATION__NAME, oldName, name));
}
/**
*
*
* @generated
*/
@Override
public EList getParameters()
{
if (parameters == null)
{
parameters = new EObjectContainmentEList(Parameter.class, this, TacticdslPackage.DOMAIN_OBJECT_OPERATION__PARAMETERS);
}
return parameters;
}
/**
*
*
* @generated
*/
@Override
public String getThrows()
{
return throws_;
}
/**
*
*
* @generated
*/
@Override
public void setThrows(String newThrows)
{
String oldThrows = throws_;
throws_ = newThrows;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.DOMAIN_OBJECT_OPERATION__THROWS, oldThrows, throws_));
}
/**
*
*
* @generated
*/
@Override
public String getHint()
{
return hint;
}
/**
*
*
* @generated
*/
@Override
public void setHint(String newHint)
{
String oldHint = hint;
hint = newHint;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.DOMAIN_OBJECT_OPERATION__HINT, oldHint, hint));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__RETURN_TYPE:
return basicSetReturnType(null, msgs);
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__PARAMETERS:
return ((InternalEList>)getParameters()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__DOC:
return getDoc();
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__ABSTRACT:
return isAbstract();
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__VISIBILITY:
return getVisibility();
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__RETURN_TYPE:
return getReturnType();
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__NAME:
return getName();
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__PARAMETERS:
return getParameters();
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__THROWS:
return getThrows();
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__HINT:
return getHint();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__DOC:
setDoc((String)newValue);
return;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__ABSTRACT:
setAbstract((Boolean)newValue);
return;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__VISIBILITY:
setVisibility((Visibility)newValue);
return;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__RETURN_TYPE:
setReturnType((ComplexType)newValue);
return;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__NAME:
setName((String)newValue);
return;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__PARAMETERS:
getParameters().clear();
getParameters().addAll((Collection extends Parameter>)newValue);
return;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__THROWS:
setThrows((String)newValue);
return;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__HINT:
setHint((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__DOC:
setDoc(DOC_EDEFAULT);
return;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__ABSTRACT:
setAbstract(ABSTRACT_EDEFAULT);
return;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__VISIBILITY:
setVisibility(VISIBILITY_EDEFAULT);
return;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__RETURN_TYPE:
setReturnType((ComplexType)null);
return;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__NAME:
setName(NAME_EDEFAULT);
return;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__PARAMETERS:
getParameters().clear();
return;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__THROWS:
setThrows(THROWS_EDEFAULT);
return;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__HINT:
setHint(HINT_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__DOC:
return DOC_EDEFAULT == null ? doc != null : !DOC_EDEFAULT.equals(doc);
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__ABSTRACT:
return abstract_ != ABSTRACT_EDEFAULT;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__VISIBILITY:
return visibility != VISIBILITY_EDEFAULT;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__RETURN_TYPE:
return returnType != null;
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__PARAMETERS:
return parameters != null && !parameters.isEmpty();
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__THROWS:
return THROWS_EDEFAULT == null ? throws_ != null : !THROWS_EDEFAULT.equals(throws_);
case TacticdslPackage.DOMAIN_OBJECT_OPERATION__HINT:
return HINT_EDEFAULT == null ? hint != null : !HINT_EDEFAULT.equals(hint);
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (doc: ");
result.append(doc);
result.append(", abstract: ");
result.append(abstract_);
result.append(", visibility: ");
result.append(visibility);
result.append(", name: ");
result.append(name);
result.append(", throws: ");
result.append(throws_);
result.append(", hint: ");
result.append(hint);
result.append(')');
return result.toString();
}
} //DomainObjectOperationImpl