org.eclipse.uml2
Interface Constraint

All Superinterfaces:
Element, EModelElement, EObject, NamedElement, Notifier, PackageableElement, ParameterableElement, TemplateableElement
All Known Subinterfaces:
DurationConstraint, InteractionConstraint, IntervalConstraint, TimeConstraint

public interface Constraint
extends PackageableElement

A representation of the model object 'Constraint'. Constraint contains a ValueSpecification that specifies additional semantics for one or more elements. Certain kinds of constraints (such as an association �xor� constraint) are predefined in UML, others may be user-defined. A user-defined Constraint is described using a specified language, whose syntax and interpretation is a tool responsibility. One predefined language for writing constraints is OCL. In some situations, a programming language such as Java may be appropriate for expressing a constraint. In other situations natural language may be used. Constraint is a condition (a Boolean expression) that restricts the extension of the associated element beyond what is imposed by the other language constructs applied to that element. Constraint contains an optional name, although they are commonly unnamed.

The following features are supported:

See Also:
UML2Package.getConstraint()

Field Summary
static String copyright
           
 
Fields inherited from interface org.eclipse.uml2.NamedElement
SEPARATOR
 
Method Summary
 ValueSpecification createSpecification(EClass eClass)
          Creates a ValueSpecification and sets the 'Specification' containment reference
 EList getConstrainedElements()
          Returns the value of the 'Constrained Element' reference list.
 Namespace getContext()
          Returns the value of the 'Context' reference
 Namespace getNamespace()
          Returns the value of the 'Namespace' container reference.
 EList getOwnedElements()
           
 ValueSpecification getSpecification()
          Returns the value of the 'Specification' containment reference
 void setNamespace(Namespace value)
          Sets the value of the 'Namespace' container reference
 void setSpecification(ValueSpecification value)
          Sets the value of the 'Specification' containment reference
 boolean validateNotApplyToSelf(DiagnosticChain diagnostics, Map context)
           An invariant constraint based on the following OCL expression: not constrainedElement->includes(self)
 
Methods inherited from interface org.eclipse.uml2.PackageableElement
getPackageableElement_visibility, getVisibility, setPackageableElement_visibility, setVisibility
 
Methods inherited from interface org.eclipse.uml2.NamedElement
allNamespaces, createNameExpression, getClientDependencies, getClientDependency, getName, getNameExpression, getOwner, getQualifiedName, isDistinguishableFrom, qualifiedName, separator, setName, setNameExpression, validateNoName, validateQualifiedName, validateVisibilityNeedsOwnership
 
Methods inherited from interface org.eclipse.uml2.TemplateableElement
createOwnedTemplateSignature, createTemplateBinding, getOwnedTemplateSignature, getTemplateBindings, parameterableElements, setOwnedTemplateSignature
 
Methods inherited from interface org.eclipse.uml2.Element
addKeyword, allOwnedElements, apply, createEAnnotation, createOwnedComment, destroy, getApplicableStereotype, getApplicableStereotypes, getAppliedStereotype, getAppliedStereotypes, getAppliedVersion, getKeywords, getModel, getNearestPackage, getOwnedComments, getValue, hasKeyword, isApplied, isRequired, mustBeOwned, removeKeyword, setValue, unapply, validateHasOwner, validateNotOwnSelf
 
Methods inherited from interface org.eclipse.emf.ecore.EModelElement
getEAnnotation, getEAnnotations
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, 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.uml2.ParameterableElement
getOwner, getOwningParameter, getTemplateParameter, setOwningParameter, setTemplateParameter
 

Field Detail

copyright

public static final String copyright

See Also:
Constant Field Values
Method Detail

getContext

public Namespace getContext()
Returns the value of the 'Context' reference.

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

Specifies the Namespace that is the context for evaluating this constraint. This is a derived union.

Returns:
the value of the 'Context' reference.
See Also:
UML2Package.getConstraint_Context()

getNamespace

public Namespace getNamespace()
Returns the value of the 'Namespace' container reference. It is bidirectional and its opposite is 'Owned Rule'.

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

Specified by:
getNamespace in interface NamedElement
Returns:
the value of the 'Namespace' container reference.
See Also:
setNamespace(Namespace), UML2Package.getConstraint_Namespace(), Namespace.getOwnedRules()

setNamespace

public void setNamespace(Namespace value)
Sets the value of the 'Namespace' container reference.

Parameters:
value - the new value of the 'Namespace' container reference.
See Also:
getNamespace()

getSpecification

public ValueSpecification getSpecification()
Returns the value of the 'Specification' containment reference.

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

A condition that must be true when evaluated in order for the constraint to be satisfied. Subsets Element::ownedElement.

Returns:
the value of the 'Specification' containment reference.
See Also:
setSpecification(ValueSpecification), UML2Package.getConstraint_Specification()

setSpecification

public 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()

createSpecification

public ValueSpecification createSpecification(EClass eClass)
Creates a ValueSpecification and sets the 'Specification' containment reference.

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

getConstrainedElements

public EList getConstrainedElements()
Returns the value of the 'Constrained Element' reference list. The list contents are of type Element.

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

ordered set of Elements referenced by this Constraint.

Returns:
the value of the 'Constrained Element' reference list.
See Also:
UML2Package.getConstraint_ConstrainedElement()

validateNotApplyToSelf

public boolean validateNotApplyToSelf(DiagnosticChain diagnostics,
                                      Map context)
An invariant constraint based on the following OCL expression: not constrainedElement->includes(self)


getOwnedElements

public EList getOwnedElements()

Specified by:
getOwnedElements in interface NamedElement

Copyright 2003, 2004 IBM Corporation and others.
All Rights Reserved.