be.ac.vub.cocompose.lang.impl.constraints
Class DefaultElementConstraint
java.lang.Object
be.ac.vub.cocompose.lang.impl.DefaultElement
be.ac.vub.cocompose.lang.impl.core.DefaultModelElement
be.ac.vub.cocompose.lang.impl.core.DefaultNamespace
be.ac.vub.cocompose.lang.impl.constraints.DefaultConstraint
be.ac.vub.cocompose.lang.impl.constraints.DefaultElementConstraint
- All Implemented Interfaces:
- Cloneable, Constraint, Element, ElementConstraint, ModelElement, Namespace, VisitedElement
- public class DefaultElementConstraint
- extends DefaultConstraint
- implements ElementConstraint
Model element constraint.
- Since:
- 0.2.0
- Version:
- 0.2.0
- Author:
- Dennis Wagelaar
Methods inherited from class be.ac.vub.cocompose.lang.impl.core.DefaultNamespace |
addOwnedElement, addOwnedElement, getDeepOwnedElements, getOwnedElement, getOwnedElementId, getOwnedElements, getOwnedElements, isRegistered, registerNameChange, removeOwnedElement, translateIndex, translateIndex |
DefaultElementConstraint
public DefaultElementConstraint()
getConstrainedElements
public Collection getConstrainedElements()
- Returns the constrained elements.
- Specified by:
getConstrainedElements
in interface ElementConstraint
- Returns:
- a copy of the collection of constrained elements.
accept
public void accept(ModelVisitor modelVisitor)
throws ModelElementException
- Accepts a visitor.
- Specified by:
accept
in interface VisitedElement
- Overrides:
accept
in class DefaultConstraint
- Parameters:
modelVisitor
- The visitor to accept.
- Throws:
ModelElementException
acceptSuper
public void acceptSuper(ModelVisitor modelVisitor)
throws ModelElementException
- Invokes superclass accept().
- Overrides:
acceptSuper
in class DefaultConstraint
- Parameters:
modelVisitor
- The visitor to accept.
- Throws:
ModelElementException
- See Also:
accept(ModelVisitor)
addConstrainedElement
public void addConstrainedElement(ModelElement constrainedElement)
- Adds a constrained element.
- Specified by:
addConstrainedElement
in interface ElementConstraint
- Parameters:
constrainedElement
- - the element to add.
removeConstrainedElement
public void removeConstrainedElement(ModelElement constrainedElement)
- Removes a constrained element.
- Specified by:
removeConstrainedElement
in interface ElementConstraint
- Parameters:
constrainedElement
- - the element to remove.
concreteCheck
protected void concreteCheck()
throws ModelElementException
- Checks whether the constraint holds.
- Specified by:
concreteCheck
in class DefaultConstraint
- Throws:
ModelElementException
- - if the constraint doesn't hold.