org.eclipse.ocl.examples.pivot
Interface MessageExp

All Superinterfaces:
DomainElement, DomainExpression, DomainNamedElement, DomainTypedElement, Element, org.eclipse.emf.ecore.EObject, Nameable, NamedElement, org.eclipse.emf.common.notify.Notifier, OCLExpression, PivotObject, TypedElement, Visitable
All Known Implementing Classes:
MessageExpImpl

public interface MessageExp
extends OCLExpression

A representation of the model object 'Message Exp'.

The following features are supported:

See Also:
PivotPackage.getMessageExp()
Generated
Model

Method Summary
 OCLExpression createArgument(org.eclipse.emf.ecore.EClass eClass)
          Creates a new OCLExpression and appends it to the 'Argument' containment reference list.
 CallOperationAction createCalledOperation()
          Creates a new CallOperationAction and sets the 'Called Operation' containment reference.
 SendSignalAction createSentSignal()
          Creates a new SendSignalAction and sets the 'Sent Signal' containment reference.
 OCLExpression createTarget(org.eclipse.emf.ecore.EClass eClass)
          Creates a new OCLExpression and sets the 'Target' containment reference.
 org.eclipse.emf.common.util.EList<OCLExpression> getArgument()
          Returns the value of the 'Argument' containment reference list.
 CallOperationAction getCalledOperation()
          Returns the value of the 'Called Operation' containment reference.
 SendSignalAction getSentSignal()
          Returns the value of the 'Sent Signal' containment reference.
 OCLExpression getTarget()
          Returns the value of the 'Target' containment reference.
 void setCalledOperation(CallOperationAction value)
          Sets the value of the 'Called Operation' containment reference.
 void setSentSignal(SendSignalAction value)
          Sets the value of the 'Sent Signal' containment reference.
 void setTarget(OCLExpression value)
          Sets the value of the 'Target' containment reference.
 boolean validateOneCallOrOneSend(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          An OCL message has either a called operation or a sent signal.
 boolean validateTargetIsNotACollection(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          The target of an OCL message cannot be a collection.
 
Methods inherited from interface org.eclipse.ocl.examples.pivot.TypedElement
getType, setType
 
Methods inherited from interface org.eclipse.ocl.examples.pivot.NamedElement
createOwnedAnnotation, createOwnedRule, getName, getOwnedAnnotation, getOwnedRule, isStatic, setIsStatic, setName
 
Methods inherited from interface org.eclipse.ocl.examples.pivot.Element
allOwnedElements, createOwnedComment, getETarget, getOwnedComment, validateNotOwnSelf
 
Methods inherited from interface org.eclipse.ocl.examples.pivot.util.Visitable
accept, eClass
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 
Methods inherited from interface org.eclipse.ocl.examples.domain.elements.DomainNamedElement
getName
 
Methods inherited from interface org.eclipse.ocl.examples.domain.elements.DomainExpression
getType
 

Method Detail

getTarget

OCLExpression getTarget()
Returns the value of the 'Target' containment reference.

If the meaning of the 'Target' containment reference isn't clear, there really should be more of a description here...

Returns:
the value of the 'Target' containment reference.
See Also:
setTarget(OCLExpression), PivotPackage.getMessageExp_Target()
Generated
Model
containment="true" required="true" ordered="false" annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://www.eclipse.org/ocl/3.1.0/Pivot!MessageExp!target'"

setTarget

void setTarget(OCLExpression value)
Sets the value of the 'Target' containment reference.

Parameters:
value - the new value of the 'Target' containment reference.
See Also:
getTarget()
Generated

createTarget

OCLExpression createTarget(org.eclipse.emf.ecore.EClass eClass)
Creates a new OCLExpression and sets the 'Target' containment reference.

Parameters:
eClass - The Ecore class of the OCLExpression to create.
Returns:
The new OCLExpression.
See Also:
getTarget()
Generated

getArgument

org.eclipse.emf.common.util.EList<OCLExpression> getArgument()
Returns the value of the 'Argument' containment reference list. The list contents are of type OCLExpression.

If the meaning of the 'Argument' containment reference list isn't clear, there really should be more of a description here...

Returns:
the value of the 'Argument' containment reference list.
See Also:
PivotPackage.getMessageExp_Argument()
Generated
Model
containment="true" annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://www.eclipse.org/ocl/3.1.0/Pivot!MessageExp!argument'"

createArgument

OCLExpression createArgument(org.eclipse.emf.ecore.EClass eClass)
Creates a new OCLExpression and appends it to the 'Argument' containment reference list.

Parameters:
eClass - The Ecore class of the OCLExpression to create.
Returns:
The new OCLExpression.
See Also:
getArgument()
Generated

getCalledOperation

CallOperationAction getCalledOperation()
Returns the value of the 'Called Operation' containment reference.

If the meaning of the 'Called Operation' containment reference isn't clear, there really should be more of a description here...

Returns:
the value of the 'Called Operation' containment reference.
See Also:
setCalledOperation(CallOperationAction), PivotPackage.getMessageExp_CalledOperation()
Generated
Model
containment="true" ordered="false" annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://www.eclipse.org/ocl/3.1.0/Pivot!MessageExp!calledOperation'"

setCalledOperation

void setCalledOperation(CallOperationAction value)
Sets the value of the 'Called Operation' containment reference.

Parameters:
value - the new value of the 'Called Operation' containment reference.
See Also:
getCalledOperation()
Generated

createCalledOperation

CallOperationAction createCalledOperation()
Creates a new CallOperationAction and sets the 'Called Operation' containment reference.

Returns:
The new CallOperationAction.
See Also:
getCalledOperation()
Generated

getSentSignal

SendSignalAction getSentSignal()
Returns the value of the 'Sent Signal' containment reference.

If the meaning of the 'Sent Signal' containment reference isn't clear, there really should be more of a description here...

Returns:
the value of the 'Sent Signal' containment reference.
See Also:
setSentSignal(SendSignalAction), PivotPackage.getMessageExp_SentSignal()
Generated
Model
containment="true" ordered="false" annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://www.eclipse.org/ocl/3.1.0/Pivot!MessageExp!sentSignal'"

setSentSignal

void setSentSignal(SendSignalAction value)
Sets the value of the 'Sent Signal' containment reference.

Parameters:
value - the new value of the 'Sent Signal' containment reference.
See Also:
getSentSignal()
Generated

createSentSignal

SendSignalAction createSentSignal()
Creates a new SendSignalAction and sets the 'Sent Signal' containment reference.

Returns:
The new SendSignalAction.
See Also:
getSentSignal()
Generated

validateTargetIsNotACollection

boolean validateTargetIsNotACollection(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                       java.util.Map<java.lang.Object,java.lang.Object> context)
The target of an OCL message cannot be a collection.

Generated
Model
annotation="http://www.eclipse.org/emf/2002/GenModel body='/*\nnot target.type.oclIsKindOf(CollectionType)\n\052/\ntry {\n\tfinal <%org.eclipse.ocl.examples.domain.evaluation.DomainEvaluator%> evaluator = new <%org.eclipse.ocl.examples.library.ecore.EcoreExecutorManager%>(this, null, <%org.eclipse.ocl.examples.pivot.PivotTables%>.LIBRARY);\n\tfinal <%org.eclipse.ocl.examples.domain.values.ValueFactory%> valueFactory = evaluator.getValueFactory();\n\tfinal <%org.eclipse.ocl.examples.domain.values.Value%> self = valueFactory.valueOf(this);\n\tfinal <%org.eclipse.ocl.examples.library.executor.ExecutorType%> T_Boolean = <%org.eclipse.ocl.examples.library.oclstdlib.OCLstdlibTables%>.Types._Boolean;\n\t\n\tfinal <%org.eclipse.ocl.examples.domain.elements.DomainType%> returnType = T_Boolean;\n\tfinal <%org.eclipse.ocl.examples.domain.values.Value%> result = <%org.eclipse.ocl.examples.pivot.bodies.MessageExpBodies%>._invariant_TargetIsNotACollection.INSTANCE.evaluate(evaluator, returnType, self);\n\tfinal boolean resultIsNull = result.isNull();\n\tif (!resultIsNull && result.asBoolean()) {\t// true => true, false/null => dropthrough, invalid => exception\n\t\treturn true;\n\t}\n\tif (diagnostics != null) {\n\t\tint severity = resultIsNull ? <%org.eclipse.emf.common.util.Diagnostic%>.ERROR : <%org.eclipse.emf.common.util.Diagnostic%>.WARNING;\n\t\tString message = <%org.eclipse.osgi.util.NLS%>.bind(<%org.eclipse.ocl.examples.domain.messages.EvaluatorMessages%>.ValidationConstraintIsNotSatisfied_ERROR_, new Object[]{\"MessageExp\", \"TargetIsNotACollection\", <%org.eclipse.emf.ecore.util.EObjectValidator%>.getObjectLabel(this, context)});\n\t diagnostics.add(new <%org.eclipse.emf.common.util.BasicDiagnostic%>(severity, <%org.eclipse.ocl.examples.pivot.util.PivotValidator%>.DIAGNOSTIC_SOURCE, <%org.eclipse.ocl.examples.pivot.util.PivotValidator%>.MESSAGE_EXP__TARGET_IS_NOT_ACOLLECTION, message, new Object [] { this }));\n\t}\n\treturn false;\n} catch (<%org.eclipse.ocl.examples.domain.evaluation.InvalidValueException%> e) {\n\tString message = <%org.eclipse.osgi.util.NLS%>.bind(<%org.eclipse.ocl.examples.domain.messages.EvaluatorMessages%>.ValidationEvaluationFailed_ERROR_, new Object[]{\"MessageExp\", \"TargetIsNotACollection\", <%org.eclipse.emf.ecore.util.EObjectValidator%>.getObjectLabel(this, context)});\n\tthrow new <%org.eclipse.emf.common.util.WrappedException%>(message, e);\n}\n'"

validateOneCallOrOneSend

boolean validateOneCallOrOneSend(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                 java.util.Map<java.lang.Object,java.lang.Object> context)
An OCL message has either a called operation or a sent signal.

Generated
Model
annotation="http://www.eclipse.org/emf/2002/GenModel body='/*\ncalledOperation->size() + sentSignal->size() = 1\n\052/\ntry {\n\tfinal <%org.eclipse.ocl.examples.domain.evaluation.DomainEvaluator%> evaluator = new <%org.eclipse.ocl.examples.library.ecore.EcoreExecutorManager%>(this, null, <%org.eclipse.ocl.examples.pivot.PivotTables%>.LIBRARY);\n\tfinal <%org.eclipse.ocl.examples.domain.values.ValueFactory%> valueFactory = evaluator.getValueFactory();\n\tfinal <%org.eclipse.ocl.examples.domain.values.Value%> self = valueFactory.valueOf(this);\n\tfinal <%org.eclipse.ocl.examples.library.executor.ExecutorType%> T_Boolean = <%org.eclipse.ocl.examples.library.oclstdlib.OCLstdlibTables%>.Types._Boolean;\n\t\n\tfinal <%org.eclipse.ocl.examples.domain.elements.DomainType%> returnType = T_Boolean;\n\tfinal <%org.eclipse.ocl.examples.domain.values.Value%> result = <%org.eclipse.ocl.examples.pivot.bodies.MessageExpBodies%>._invariant_OneCallOrOneSend.INSTANCE.evaluate(evaluator, returnType, self);\n\tfinal boolean resultIsNull = result.isNull();\n\tif (!resultIsNull && result.asBoolean()) {\t// true => true, false/null => dropthrough, invalid => exception\n\t\treturn true;\n\t}\n\tif (diagnostics != null) {\n\t\tint severity = resultIsNull ? <%org.eclipse.emf.common.util.Diagnostic%>.ERROR : <%org.eclipse.emf.common.util.Diagnostic%>.WARNING;\n\t\tString message = <%org.eclipse.osgi.util.NLS%>.bind(<%org.eclipse.ocl.examples.domain.messages.EvaluatorMessages%>.ValidationConstraintIsNotSatisfied_ERROR_, new Object[]{\"MessageExp\", \"OneCallOrOneSend\", <%org.eclipse.emf.ecore.util.EObjectValidator%>.getObjectLabel(this, context)});\n\t diagnostics.add(new <%org.eclipse.emf.common.util.BasicDiagnostic%>(severity, <%org.eclipse.ocl.examples.pivot.util.PivotValidator%>.DIAGNOSTIC_SOURCE, <%org.eclipse.ocl.examples.pivot.util.PivotValidator%>.MESSAGE_EXP__ONE_CALL_OR_ONE_SEND, message, new Object [] { this }));\n\t}\n\treturn false;\n} catch (<%org.eclipse.ocl.examples.domain.evaluation.InvalidValueException%> e) {\n\tString message = <%org.eclipse.osgi.util.NLS%>.bind(<%org.eclipse.ocl.examples.domain.messages.EvaluatorMessages%>.ValidationEvaluationFailed_ERROR_, new Object[]{\"MessageExp\", \"OneCallOrOneSend\", <%org.eclipse.emf.ecore.util.EObjectValidator%>.getObjectLabel(this, context)});\n\tthrow new <%org.eclipse.emf.common.util.WrappedException%>(message, e);\n}\n'"