diff options
Diffstat (limited to 'plugins/uml/alf/org.eclipse.papyrus.uml.alf/syntax-gen/org/eclipse/papyrus/uml/alf/impl/EnumerationDefinitionImpl.java')
-rw-r--r-- | plugins/uml/alf/org.eclipse.papyrus.uml.alf/syntax-gen/org/eclipse/papyrus/uml/alf/impl/EnumerationDefinitionImpl.java | 223 |
1 files changed, 223 insertions, 0 deletions
diff --git a/plugins/uml/alf/org.eclipse.papyrus.uml.alf/syntax-gen/org/eclipse/papyrus/uml/alf/impl/EnumerationDefinitionImpl.java b/plugins/uml/alf/org.eclipse.papyrus.uml.alf/syntax-gen/org/eclipse/papyrus/uml/alf/impl/EnumerationDefinitionImpl.java new file mode 100644 index 00000000000..facce2203ac --- /dev/null +++ b/plugins/uml/alf/org.eclipse.papyrus.uml.alf/syntax-gen/org/eclipse/papyrus/uml/alf/impl/EnumerationDefinitionImpl.java @@ -0,0 +1,223 @@ +/** + */ +package org.eclipse.papyrus.uml.alf.impl; + +import java.lang.reflect.InvocationTargetException; +import java.util.Map; +import org.eclipse.emf.common.util.BasicEList; +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.common.util.WrappedException; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.papyrus.uml.alf.AlfPackage; +import org.eclipse.papyrus.uml.alf.ClassifierDefinition; +import org.eclipse.papyrus.uml.alf.ElementReference; +import org.eclipse.papyrus.uml.alf.EnumerationDefinition; +import org.eclipse.papyrus.uml.alf.MemberDefinition; +import org.eclipse.papyrus.uml.alf.NamespaceDefinition; +import org.eclipse.papyrus.uml.alf.StereotypeAnnotation; +import org.eclipse.papyrus.uml.alf.UnitDefinition; +import org.eclipse.papyrus.uml.alf.util.AlfValidator; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Enumeration Definition</b></em>'. + * <!-- end-user-doc --> + * <p> + * + * @generated + */ +public class EnumerationDefinitionImpl extends ClassifierDefinitionImpl implements EnumerationDefinition { + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + protected EnumerationDefinitionImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return AlfPackage.eINSTANCE.getEnumerationDefinition(); + } + + /** + * The cached invocation delegate for the '{@link #matchForStub(org.eclipse.papyrus.uml.alf.UnitDefinition) <em>Match For Stub</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see #matchForStub(org.eclipse.papyrus.uml.alf.UnitDefinition) + * @generated + * @ordered + */ + protected static final EOperation.Internal.InvocationDelegate MATCH_FOR_STUB_UNIT_DEFINITION__EINVOCATION_DELEGATE = ((EOperation.Internal) AlfPackage.eINSTANCE.getEnumerationDefinition__MatchForStub__UnitDefinition()).getInvocationDelegate(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean matchForStub(UnitDefinition unit) { + try { + return (Boolean) MATCH_FOR_STUB_UNIT_DEFINITION__EINVOCATION_DELEGATE.dynamicInvoke(this, new BasicEList.UnmodifiableEList<Object>(1, new Object[] { unit })); + } catch (InvocationTargetException ite) { + throw new WrappedException(ite); + } + } + + /** + * The cached invocation delegate for the '{@link #annotationAllowed(org.eclipse.papyrus.uml.alf.StereotypeAnnotation) <em>Annotation Allowed</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see #annotationAllowed(org.eclipse.papyrus.uml.alf.StereotypeAnnotation) + * @generated + * @ordered + */ + protected static final EOperation.Internal.InvocationDelegate ANNOTATION_ALLOWED_STEREOTYPE_ANNOTATION__EINVOCATION_DELEGATE = ((EOperation.Internal) AlfPackage.eINSTANCE.getEnumerationDefinition__AnnotationAllowed__StereotypeAnnotation()) + .getInvocationDelegate(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean annotationAllowed(StereotypeAnnotation annotation) { + try { + return (Boolean) ANNOTATION_ALLOWED_STEREOTYPE_ANNOTATION__EINVOCATION_DELEGATE.dynamicInvoke(this, new BasicEList.UnmodifiableEList<Object>(1, new Object[] { annotation })); + } catch (InvocationTargetException ite) { + throw new WrappedException(ite); + } + } + + /** + * The cached invocation delegate for the '{@link #isSameKindAs(org.eclipse.papyrus.uml.alf.ElementReference) <em>Is Same Kind As</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see #isSameKindAs(org.eclipse.papyrus.uml.alf.ElementReference) + * @generated + * @ordered + */ + protected static final EOperation.Internal.InvocationDelegate IS_SAME_KIND_AS_ELEMENT_REFERENCE__EINVOCATION_DELEGATE = ((EOperation.Internal) AlfPackage.eINSTANCE.getEnumerationDefinition__IsSameKindAs__ElementReference()).getInvocationDelegate(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean isSameKindAs(ElementReference member) { + try { + return (Boolean) IS_SAME_KIND_AS_ELEMENT_REFERENCE__EINVOCATION_DELEGATE.dynamicInvoke(this, new BasicEList.UnmodifiableEList<Object>(1, new Object[] { member })); + } catch (InvocationTargetException ite) { + throw new WrappedException(ite); + } + } + + /** + * The cached validation expression for the '{@link #enumerationDefinitionSpecializationReferent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Enumeration Definition Specialization Referent</em>}' invariant operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see #enumerationDefinitionSpecializationReferent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + * @ordered + */ + protected static final String ENUMERATION_DEFINITION_SPECIALIZATION_REFERENT_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION = "\n" + + " self.specializationReferent->forAll(isEnumeration())"; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean enumerationDefinitionSpecializationReferent(DiagnosticChain diagnostics, Map<Object, Object> context) { + return AlfValidator.validate + (AlfPackage.eINSTANCE.getEnumerationDefinition(), + this, + diagnostics, + context, + "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", + AlfPackage.eINSTANCE.getEnumerationDefinition__EnumerationDefinitionSpecializationReferent__DiagnosticChain_Map(), + ENUMERATION_DEFINITION_SPECIALIZATION_REFERENT_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION, + Diagnostic.ERROR, + AlfValidator.DIAGNOSTIC_SOURCE, + AlfValidator.ENUMERATION_DEFINITION__ENUMERATION_DEFINITION_SPECIALIZATION_REFERENT); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public int eDerivedOperationID(int baseOperationID, Class<?> baseClass) { + if (baseClass == MemberDefinition.class) { + switch (baseOperationID) { + case AlfPackage.MEMBER_DEFINITION___ANNOTATION_ALLOWED__STEREOTYPEANNOTATION: + return AlfPackage.ENUMERATION_DEFINITION___ANNOTATION_ALLOWED__STEREOTYPEANNOTATION; + case AlfPackage.MEMBER_DEFINITION___MATCH_FOR_STUB__UNITDEFINITION: + return AlfPackage.ENUMERATION_DEFINITION___MATCH_FOR_STUB__UNITDEFINITION; + case AlfPackage.MEMBER_DEFINITION___IS_SAME_KIND_AS__ELEMENTREFERENCE: + return AlfPackage.ENUMERATION_DEFINITION___IS_SAME_KIND_AS__ELEMENTREFERENCE; + default: + return super.eDerivedOperationID(baseOperationID, baseClass); + } + } + if (baseClass == NamespaceDefinition.class) { + switch (baseOperationID) { + case AlfPackage.NAMESPACE_DEFINITION___ANNOTATION_ALLOWED__STEREOTYPEANNOTATION: + return AlfPackage.ENUMERATION_DEFINITION___ANNOTATION_ALLOWED__STEREOTYPEANNOTATION; + default: + return super.eDerivedOperationID(baseOperationID, baseClass); + } + } + if (baseClass == ClassifierDefinition.class) { + switch (baseOperationID) { + case AlfPackage.CLASSIFIER_DEFINITION___MATCH_FOR_STUB__UNITDEFINITION: + return AlfPackage.ENUMERATION_DEFINITION___MATCH_FOR_STUB__UNITDEFINITION; + default: + return super.eDerivedOperationID(baseOperationID, baseClass); + } + } + return super.eDerivedOperationID(baseOperationID, baseClass); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + @SuppressWarnings("unchecked") + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException { + switch (operationID) { + case AlfPackage.ENUMERATION_DEFINITION___MATCH_FOR_STUB__UNITDEFINITION: + return matchForStub((UnitDefinition) arguments.get(0)); + case AlfPackage.ENUMERATION_DEFINITION___ANNOTATION_ALLOWED__STEREOTYPEANNOTATION: + return annotationAllowed((StereotypeAnnotation) arguments.get(0)); + case AlfPackage.ENUMERATION_DEFINITION___IS_SAME_KIND_AS__ELEMENTREFERENCE: + return isSameKindAs((ElementReference) arguments.get(0)); + case AlfPackage.ENUMERATION_DEFINITION___ENUMERATION_DEFINITION_SPECIALIZATION_REFERENT__DIAGNOSTICCHAIN_MAP: + return enumerationDefinitionSpecializationReferent((DiagnosticChain) arguments.get(0), (Map<Object, Object>) arguments.get(1)); + } + return super.eInvoke(operationID, arguments); + } + +} // EnumerationDefinitionImpl |