org.eclipse.ocl.examples.pivot
Interface Constraint

All Superinterfaces:
DomainElement, Element, org.eclipse.emf.ecore.EObject, Nameable, NamedElement, org.eclipse.emf.common.notify.Notifier, PivotObject, Visitable
All Known Implementing Classes:
ConstraintImpl

public interface Constraint
extends NamedElement

A representation of the model object 'Constraint'. A constraint is a condition or restriction expressed in natural language text or in a machine readable language for the purpose of declaring some of the semantics of an element.

The following features are supported:

See Also:
PivotPackage.getConstraint()
Generated
Model

Method Summary
 ValueSpecification createSpecification(org.eclipse.emf.ecore.EClass eClass)
          Creates a new ValueSpecification and sets the 'Specification' containment reference.
 org.eclipse.emf.common.util.EList<Element> getConstrainedElement()
          Returns the value of the 'Constrained Element' reference list.
 NamedElement getContext()
          Returns the value of the 'Context' container reference.
 ValueSpecification getSpecification()
          Returns the value of the 'Specification' containment reference.
 java.lang.String getStereotype()
          Returns the value of the 'Stereotype' attribute.
 boolean isCallable()
          Returns the value of the 'Is Callable' attribute.
 void setContext(NamedElement value)
          Sets the value of the 'Context' container reference.
 void setIsCallable(boolean value)
          Sets the value of the 'Is Callable' attribute.
 void setSpecification(ValueSpecification value)
          Sets the value of the 'Specification' containment reference.
 void setStereotype(java.lang.String value)
          Sets the value of the 'Stereotype' attribute.
 boolean validateUniqueName(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
           
 
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
 

Method Detail

getConstrainedElement

org.eclipse.emf.common.util.EList<Element> getConstrainedElement()
Returns the value of the 'Constrained Element' reference list. The list contents are of type Element. The ordered set of Elements referenced by this Constraint.

Returns:
the value of the 'Constrained Element' reference list.
See Also:
PivotPackage.getConstraint_ConstrainedElement()
Generated
Model
annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://www.eclipse.org/ocl/3.1.0/Pivot!Constraint!constrainedElement'"

getSpecification

ValueSpecification getSpecification()
Returns the value of the 'Specification' containment reference. A condition that must be true when evaluated in order for the constraint to be satisfied.

Returns:
the value of the 'Specification' containment reference.
See Also:
setSpecification(ValueSpecification), PivotPackage.getConstraint_Specification()
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!Constraint!specification'"

setSpecification

void setSpecification(ValueSpecification value)
Sets the value of the 'Specification' containment reference.

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

createSpecification

ValueSpecification createSpecification(org.eclipse.emf.ecore.EClass eClass)
Creates a new ValueSpecification and sets the 'Specification' containment reference.

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

getContext

NamedElement getContext()
Returns the value of the 'Context' container reference. It is bidirectional and its opposite is 'Owned Rule'.

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

Returns:
the value of the 'Context' container reference.
See Also:
setContext(NamedElement), PivotPackage.getConstraint_Context(), NamedElement.getOwnedRule()
Generated
Model
opposite="ownedRule" transient="false" 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!Constraint!context'"

setContext

void setContext(NamedElement value)
Sets the value of the 'Context' container reference.

Parameters:
value - the new value of the 'Context' container reference.
See Also:
getContext()
Generated

validateUniqueName

boolean validateUniqueName(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                           java.util.Map<java.lang.Object,java.lang.Object> context)

Generated
Model
annotation="http://www.eclipse.org/emf/2002/GenModel body='/*\ncontext.ownedRule->excluding(self)\n->forAll(name <> self.name or stereotype <> self.stereotype)\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.ConstraintBodies%>._invariant_UniqueName.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[]{\"Constraint\", \"UniqueName\", <%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%>.CONSTRAINT__UNIQUE_NAME, 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[]{\"Constraint\", \"UniqueName\", <%org.eclipse.emf.ecore.util.EObjectValidator%>.getObjectLabel(this, context)});\n\tthrow new <%org.eclipse.emf.common.util.WrappedException%>(message, e);\n}\n'"

getStereotype

java.lang.String getStereotype()
Returns the value of the 'Stereotype' attribute.

If the meaning of the 'Stereotype' attribute isn't clear, there really should be more of a description here...

Returns:
the value of the 'Stereotype' attribute.
See Also:
setStereotype(String), PivotPackage.getConstraint_Stereotype()
Generated
Model
dataType="org.eclipse.ocl.examples.pivot.String" 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!Constraint!stereotype'"

setStereotype

void setStereotype(java.lang.String value)
Sets the value of the 'Stereotype' attribute.

Parameters:
value - the new value of the 'Stereotype' attribute.
See Also:
getStereotype()
Generated

isCallable

boolean isCallable()
Returns the value of the 'Is Callable' attribute. The default value is "false".

If the meaning of the 'Is Callable' attribute isn't clear, there really should be more of a description here...

Returns:
the value of the 'Is Callable' attribute.
See Also:
setIsCallable(boolean), PivotPackage.getConstraint_IsCallable()
Generated
Model
default="false" dataType="org.eclipse.ocl.examples.pivot.Boolean" 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!Constraint!isCallable'"

setIsCallable

void setIsCallable(boolean value)
Sets the value of the 'Is Callable' attribute.

Parameters:
value - the new value of the 'Is Callable' attribute.
See Also:
isCallable()
Generated