blob: 655fc580f6625275ac6301605af7a60063a40d84 [file] [log] [blame]
/**
*/
package org.eclipse.papyrus.bpmn.BPMNProfile.impl;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.DiagnosticChain;
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.plugin.EcorePlugin;
import org.eclipse.emf.ecore.util.EObjectValidator;
import org.eclipse.papyrus.bpmn.BPMNProfile.BPMNProfilePackage;
import org.eclipse.papyrus.bpmn.BPMNProfile.ItemDefinition;
import org.eclipse.papyrus.bpmn.BPMNProfile.ResourceParameter;
import org.eclipse.papyrus.bpmn.BPMNProfile.util.BPMNProfileValidator;
import org.eclipse.uml2.uml.Property;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Resource Parameter</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ResourceParameterImpl#getBase_Property <em>Base Property</em>}</li>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ResourceParameterImpl#getType <em>Type</em>}</li>
* <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.ResourceParameterImpl#isRequired <em>Is Required</em>}</li>
* </ul>
*
* @generated
*/
public class ResourceParameterImpl extends BaseElementImpl implements ResourceParameter {
/**
* The cached value of the '{@link #getBase_Property() <em>Base Property</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBase_Property()
* @generated
* @ordered
*/
protected Property base_Property;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected ItemDefinition type;
/**
* The default value of the '{@link #isRequired() <em>Is Required</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isRequired()
* @generated
* @ordered
*/
protected static final boolean IS_REQUIRED_EDEFAULT = false;
/**
* The cached value of the '{@link #isRequired() <em>Is Required</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isRequired()
* @generated
* @ordered
*/
protected boolean isRequired = IS_REQUIRED_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ResourceParameterImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BPMNProfilePackage.eINSTANCE.getResourceParameter();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Property getBase_Property() {
if (base_Property != null && base_Property.eIsProxy()) {
InternalEObject oldBase_Property = (InternalEObject)base_Property;
base_Property = (Property)eResolveProxy(oldBase_Property);
if (base_Property != oldBase_Property) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.RESOURCE_PARAMETER__BASE_PROPERTY, oldBase_Property, base_Property));
}
}
return base_Property;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Property basicGetBase_Property() {
return base_Property;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBase_Property(Property newBase_Property) {
Property oldBase_Property = base_Property;
base_Property = newBase_Property;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.RESOURCE_PARAMETER__BASE_PROPERTY, oldBase_Property, base_Property));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ItemDefinition getType() {
if (type != null && type.eIsProxy()) {
InternalEObject oldType = (InternalEObject)type;
type = (ItemDefinition)eResolveProxy(oldType);
if (type != oldType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BPMNProfilePackage.RESOURCE_PARAMETER__TYPE, oldType, type));
}
}
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ItemDefinition basicGetType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(ItemDefinition newType) {
ItemDefinition oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.RESOURCE_PARAMETER__TYPE, oldType, type));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isRequired() {
return isRequired;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIsRequired(boolean newIsRequired) {
boolean oldIsRequired = isRequired;
isRequired = newIsRequired;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BPMNProfilePackage.RESOURCE_PARAMETER__IS_REQUIRED, oldIsRequired, isRequired));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean ResourceParameterowner(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
BPMNProfileValidator.DIAGNOSTIC_SOURCE,
BPMNProfileValidator.RESOURCE_PARAMETER__RESOURCE_PARAMETEROWNER,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ResourceParameterowner", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean ResourceParametertype(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
BPMNProfileValidator.DIAGNOSTIC_SOURCE,
BPMNProfileValidator.RESOURCE_PARAMETER__RESOURCE_PARAMETERTYPE,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ResourceParametertype", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean ResourceParameterisRequired(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
BPMNProfileValidator.DIAGNOSTIC_SOURCE,
BPMNProfileValidator.RESOURCE_PARAMETER__RESOURCE_PARAMETERIS_REQUIRED,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ResourceParameterisRequired", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BPMNProfilePackage.RESOURCE_PARAMETER__BASE_PROPERTY:
if (resolve) return getBase_Property();
return basicGetBase_Property();
case BPMNProfilePackage.RESOURCE_PARAMETER__TYPE:
if (resolve) return getType();
return basicGetType();
case BPMNProfilePackage.RESOURCE_PARAMETER__IS_REQUIRED:
return isRequired();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BPMNProfilePackage.RESOURCE_PARAMETER__BASE_PROPERTY:
setBase_Property((Property)newValue);
return;
case BPMNProfilePackage.RESOURCE_PARAMETER__TYPE:
setType((ItemDefinition)newValue);
return;
case BPMNProfilePackage.RESOURCE_PARAMETER__IS_REQUIRED:
setIsRequired((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BPMNProfilePackage.RESOURCE_PARAMETER__BASE_PROPERTY:
setBase_Property((Property)null);
return;
case BPMNProfilePackage.RESOURCE_PARAMETER__TYPE:
setType((ItemDefinition)null);
return;
case BPMNProfilePackage.RESOURCE_PARAMETER__IS_REQUIRED:
setIsRequired(IS_REQUIRED_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BPMNProfilePackage.RESOURCE_PARAMETER__BASE_PROPERTY:
return base_Property != null;
case BPMNProfilePackage.RESOURCE_PARAMETER__TYPE:
return type != null;
case BPMNProfilePackage.RESOURCE_PARAMETER__IS_REQUIRED:
return isRequired != IS_REQUIRED_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@SuppressWarnings("unchecked")
public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
switch (operationID) {
case BPMNProfilePackage.RESOURCE_PARAMETER___RESOURCE_PARAMETEROWNER__DIAGNOSTICCHAIN_MAP:
return ResourceParameterowner((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
case BPMNProfilePackage.RESOURCE_PARAMETER___RESOURCE_PARAMETERTYPE__DIAGNOSTICCHAIN_MAP:
return ResourceParametertype((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
case BPMNProfilePackage.RESOURCE_PARAMETER___RESOURCE_PARAMETERIS_REQUIRED__DIAGNOSTICCHAIN_MAP:
return ResourceParameterisRequired((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
}
return super.eInvoke(operationID, arguments);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (isRequired: ");
result.append(isRequired);
result.append(')');
return result.toString();
}
} //ResourceParameterImpl