org.openxma.dsl.dom.model.impl.ParameterImpl Maven / Gradle / Ivy
/**
*
*
*
* $Id: ParameterImpl.java 9011 2012-01-13 14:48:10Z mjohannes $
*/
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.core.model.Type;
import org.openxma.dsl.dom.DomPackage;
import org.openxma.dsl.dom.model.Parameter;
/**
*
* An implementation of the model object 'Parameter'.
*
*
* The following features are implemented:
*
* - {@link org.openxma.dsl.dom.model.impl.ParameterImpl#getType Type}
* - {@link org.openxma.dsl.dom.model.impl.ParameterImpl#isMany Many}
* - {@link org.openxma.dsl.dom.model.impl.ParameterImpl#getName Name}
*
*
*
* @generated
*/
public class ParameterImpl extends QueryParameterImpl implements Parameter {
/**
* The cached value of the '{@link #getType() Type}' reference.
*
*
* @see #getType()
* @generated
* @ordered
*/
protected Type 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 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;
/**
*
*
* @generated
*/
protected ParameterImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return DomPackage.Literals.PARAMETER;
}
/**
*
*
* @generated
*/
public Type getType() {
if (type != null && type.eIsProxy()) {
InternalEObject oldType = (InternalEObject)type;
type = (Type)eResolveProxy(oldType);
if (type != oldType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, DomPackage.PARAMETER__TYPE, oldType, type));
}
}
return type;
}
/**
*
*
* @generated
*/
public Type basicGetType() {
return type;
}
/**
*
*
* @generated
*/
public void setType(Type newType) {
Type oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.PARAMETER__TYPE, oldType, type));
}
/**
*
*
* @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.PARAMETER__MANY, oldMany, many));
}
/**
*
*
* @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.PARAMETER__NAME, oldName, name));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DomPackage.PARAMETER__TYPE:
if (resolve) return getType();
return basicGetType();
case DomPackage.PARAMETER__MANY:
return isMany();
case DomPackage.PARAMETER__NAME:
return getName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DomPackage.PARAMETER__TYPE:
setType((Type)newValue);
return;
case DomPackage.PARAMETER__MANY:
setMany((Boolean)newValue);
return;
case DomPackage.PARAMETER__NAME:
setName((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DomPackage.PARAMETER__TYPE:
setType((Type)null);
return;
case DomPackage.PARAMETER__MANY:
setMany(MANY_EDEFAULT);
return;
case DomPackage.PARAMETER__NAME:
setName(NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DomPackage.PARAMETER__TYPE:
return type != null;
case DomPackage.PARAMETER__MANY:
return many != MANY_EDEFAULT;
case DomPackage.PARAMETER__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (many: ");
result.append(many);
result.append(", name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //ParameterImpl