diff options
Diffstat (limited to 'plugins/uml/alf/org.eclipse.papyrus.uml.alf/syntax-gen/org/eclipse/papyrus/uml/alf/impl/BinaryExpressionImpl.java')
-rw-r--r-- | plugins/uml/alf/org.eclipse.papyrus.uml.alf/syntax-gen/org/eclipse/papyrus/uml/alf/impl/BinaryExpressionImpl.java | 301 |
1 files changed, 301 insertions, 0 deletions
diff --git a/plugins/uml/alf/org.eclipse.papyrus.uml.alf/syntax-gen/org/eclipse/papyrus/uml/alf/impl/BinaryExpressionImpl.java b/plugins/uml/alf/org.eclipse.papyrus.uml.alf/syntax-gen/org/eclipse/papyrus/uml/alf/impl/BinaryExpressionImpl.java new file mode 100644 index 00000000000..3e3a3a40544 --- /dev/null +++ b/plugins/uml/alf/org.eclipse.papyrus.uml.alf/syntax-gen/org/eclipse/papyrus/uml/alf/impl/BinaryExpressionImpl.java @@ -0,0 +1,301 @@ +/** + */ +package org.eclipse.papyrus.uml.alf.impl; + +import java.lang.reflect.InvocationTargetException; +import java.util.Map; +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.AssignedSource; +import org.eclipse.papyrus.uml.alf.BinaryExpression; +import org.eclipse.papyrus.uml.alf.Expression; +import org.eclipse.papyrus.uml.alf.util.AlfValidator; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Binary Expression</b></em>'. + * <!-- end-user-doc --> + * <p> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.uml.alf.impl.BinaryExpressionImpl#getOperand1 <em>Operand1</em>}</li> + * <li>{@link org.eclipse.papyrus.uml.alf.impl.BinaryExpressionImpl#getOperand2 <em>Operand2</em>}</li> + * <li>{@link org.eclipse.papyrus.uml.alf.impl.BinaryExpressionImpl#getOperator <em>Operator</em>}</li> + * </ul> + * + * @generated + */ +public abstract class BinaryExpressionImpl extends ExpressionImpl implements BinaryExpression { + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + protected BinaryExpressionImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return AlfPackage.eINSTANCE.getBinaryExpression(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public Expression getOperand1() { + return (Expression) eGet(AlfPackage.eINSTANCE.getBinaryExpression_Operand1(), true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public void setOperand1(Expression newOperand1) { + eSet(AlfPackage.eINSTANCE.getBinaryExpression_Operand1(), newOperand1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public Expression getOperand2() { + return (Expression) eGet(AlfPackage.eINSTANCE.getBinaryExpression_Operand2(), true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public void setOperand2(Expression newOperand2) { + eSet(AlfPackage.eINSTANCE.getBinaryExpression_Operand2(), newOperand2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public String getOperator() { + return (String) eGet(AlfPackage.eINSTANCE.getBinaryExpression_Operator(), true); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public void setOperator(String newOperator) { + eSet(AlfPackage.eINSTANCE.getBinaryExpression_Operator(), newOperator); + } + + /** + * The cached invocation delegate for the '{@link #validateAssignments() <em>Validate Assignments</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see #validateAssignments() + * @generated + * @ordered + */ + protected static final EOperation.Internal.InvocationDelegate VALIDATE_ASSIGNMENTS__EINVOCATION_DELEGATE = ((EOperation.Internal) AlfPackage.eINSTANCE.getBinaryExpression__ValidateAssignments()).getInvocationDelegate(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean binaryExpressionOperandMultiplicity(DiagnosticChain diagnostics, Map<Object, Object> context) { + return AlfValidator.validate + (AlfPackage.eINSTANCE.getBinaryExpression(), + this, + diagnostics, + context, + "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", + AlfPackage.eINSTANCE.getBinaryExpression__BinaryExpressionOperandMultiplicity__DiagnosticChain_Map(), + BINARY_EXPRESSION_OPERAND_MULTIPLICITY_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION, + Diagnostic.ERROR, + AlfValidator.DIAGNOSTIC_SOURCE, + AlfValidator.BINARY_EXPRESSION__BINARY_EXPRESSION_OPERAND_MULTIPLICITY); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean binaryExpressionOperandAssignments(DiagnosticChain diagnostics, Map<Object, Object> context) { + return AlfValidator.validate + (AlfPackage.eINSTANCE.getBinaryExpression(), + this, + diagnostics, + context, + "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", + AlfPackage.eINSTANCE.getBinaryExpression__BinaryExpressionOperandAssignments__DiagnosticChain_Map(), + BINARY_EXPRESSION_OPERAND_ASSIGNMENTS_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION, + Diagnostic.ERROR, + AlfValidator.DIAGNOSTIC_SOURCE, + AlfValidator.BINARY_EXPRESSION__BINARY_EXPRESSION_OPERAND_ASSIGNMENTS); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @SuppressWarnings("unchecked") + public EList<AssignedSource> updateAssignments() { + try { + return (EList<AssignedSource>) UPDATE_ASSIGNMENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + } catch (InvocationTargetException ite) { + throw new WrappedException(ite); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public int eDerivedOperationID(int baseOperationID, Class<?> baseClass) { + if (baseClass == Expression.class) { + switch (baseOperationID) { + case AlfPackage.EXPRESSION___UPDATE_ASSIGNMENTS: + return AlfPackage.BINARY_EXPRESSION___UPDATE_ASSIGNMENTS; + default: + return super.eDerivedOperationID(baseOperationID, baseClass); + } + } + return super.eDerivedOperationID(baseOperationID, baseClass); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean validateAssignments() { + try { + return (Boolean) VALIDATE_ASSIGNMENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + } catch (InvocationTargetException ite) { + throw new WrappedException(ite); + } + } + + /** + * The cached invocation delegate for the '{@link #noNullArguments() <em>No Null Arguments</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see #noNullArguments() + * @generated + * @ordered + */ + protected static final EOperation.Internal.InvocationDelegate NO_NULL_ARGUMENTS__EINVOCATION_DELEGATE = ((EOperation.Internal) AlfPackage.eINSTANCE.getBinaryExpression__NoNullArguments()).getInvocationDelegate(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean noNullArguments() { + try { + return (Boolean) NO_NULL_ARGUMENTS__EINVOCATION_DELEGATE.dynamicInvoke(this, null); + } catch (InvocationTargetException ite) { + throw new WrappedException(ite); + } + } + + /** + * The cached validation expression for the '{@link #binaryExpressionOperandMultiplicity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Binary Expression Operand Multiplicity</em>}' invariant operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see #binaryExpressionOperandMultiplicity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + * @ordered + */ + protected static final String BINARY_EXPRESSION_OPERAND_MULTIPLICITY_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION = "\n" + + " if self.noNullArguments() then\n" + + " self.operand1.upper = 1 and self.operand2.upper = 1\n" + + " else\n" + + " self.operand1.upper <= 1 and self.operand2.upper <= 2\n" + + " endif"; + /** + * The cached validation expression for the '{@link #binaryExpressionOperandAssignments(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Binary Expression Operand Assignments</em>}' invariant operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see #binaryExpressionOperandAssignments(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + * @ordered + */ + protected static final String BINARY_EXPRESSION_OPERAND_ASSIGNMENTS_DIAGNOSTIC_CHAIN_MAP__EEXPRESSION = "self.validateAssignments()"; + /** + * The cached invocation delegate for the '{@link #updateAssignments() <em>Update Assignments</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see #updateAssignments() + * @generated + * @ordered + */ + protected static final EOperation.Internal.InvocationDelegate UPDATE_ASSIGNMENTS__EINVOCATION_DELEGATE = ((EOperation.Internal) AlfPackage.eINSTANCE.getBinaryExpression__UpdateAssignments()).getInvocationDelegate(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + @SuppressWarnings("unchecked") + public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException { + switch (operationID) { + case AlfPackage.BINARY_EXPRESSION___VALIDATE_ASSIGNMENTS: + return validateAssignments(); + case AlfPackage.BINARY_EXPRESSION___NO_NULL_ARGUMENTS: + return noNullArguments(); + case AlfPackage.BINARY_EXPRESSION___BINARY_EXPRESSION_OPERAND_MULTIPLICITY__DIAGNOSTICCHAIN_MAP: + return binaryExpressionOperandMultiplicity((DiagnosticChain) arguments.get(0), (Map<Object, Object>) arguments.get(1)); + case AlfPackage.BINARY_EXPRESSION___BINARY_EXPRESSION_OPERAND_ASSIGNMENTS__DIAGNOSTICCHAIN_MAP: + return binaryExpressionOperandAssignments((DiagnosticChain) arguments.get(0), (Map<Object, Object>) arguments.get(1)); + case AlfPackage.BINARY_EXPRESSION___UPDATE_ASSIGNMENTS: + return updateAssignments(); + } + return super.eInvoke(operationID, arguments); + } + +} // BinaryExpressionImpl |