public class Constraint extends java.lang.Object implements IConstraint
| Modifier and Type | Method and Description |
|---|---|
boolean |
addListener(ConstraintListener listener)
Adds the given listener to the list of listeners to be notified on specific events regarding the constraint.
|
boolean |
addListener(ConstraintListener listener,
IViolationFilter filter)
Adds the given listener to the list of listeners to be notified on specific events regarding the constraint.
|
java.util.Set<ConstraintListener> |
getListeners()
Returns the listeners registered for the constraint.
|
IConstraintSpecification |
getSpecification()
Returns the constraint specification from which the constraint was instantiated on the validation engine.
|
java.util.Collection<IViolation> |
getStoredViolations()
Returns the violations stored by the constraint.
|
java.util.Collection<IViolation> |
listViolations()
Returns the violations retrieved from the validation engine on demand.
|
java.util.Collection<IViolation> |
listViolations(IViolationFilter filter)
Returns the violations retrieved from the validation engine on demand and filtered by the provided violation
filter.
|
boolean |
removeListener(ConstraintListener listener)
Removes the given listener from the list of listeners to be notified on specific events regarding the constraint.
|
public IConstraintSpecification getSpecification()
IConstraintgetSpecification in interface IConstraintpublic java.util.Collection<IViolation> getStoredViolations()
IConstraintViolations are stored if they have at least one listener registered.
getStoredViolations in interface IConstraintpublic java.util.Collection<IViolation> listViolations()
IConstraintlistViolations in interface IConstraintpublic java.util.Collection<IViolation> listViolations(IViolationFilter filter)
IConstraintlistViolations in interface IConstraintfilter - The violation filter instance to be used to filter the retrieved violations.public java.util.Set<ConstraintListener> getListeners()
IConstraintgetListeners in interface IConstraintpublic boolean addListener(ConstraintListener listener)
IConstraintaddListener in interface IConstraintlistener - The listener to be registered.public boolean addListener(ConstraintListener listener, IViolationFilter filter)
IConstraintaddListener in interface IConstraintlistener - The listener to be registered.true if the listener was not registered before.public boolean removeListener(ConstraintListener listener)
IConstraintremoveListener in interface IConstraintlistener - The listener to be deregistered.true if the listener was in fact registered.