public class Violation extends java.lang.Object implements IViolation
Constructor and Description |
---|
Violation() |
Modifier and Type | Method and Description |
---|---|
boolean |
addListener(ViolationListener listener)
Adds the given listener to the list of listeners to be notified on specific events regarding the violation.
|
Constraint |
getConstraint()
Returns the constraint for which the violation appeared.
|
java.util.Set<IEntry> |
getEntries()
Returns the entries for each pattern match witch corresponds to the violation.
|
java.util.Map<java.lang.String,java.lang.Object> |
getKeyObjects()
Returns the key objects Map of the violation, which serves as a unique key of the violation.
|
java.util.Set<ViolationListener> |
getListeners()
Returns the listeners registered for the violation.
|
java.lang.String |
getMessage()
Returns the message of the violation generated from the format message of the constraint specification and the
key objects.
|
java.util.Set<java.lang.Object> |
getValuesOfProperty(java.lang.String propertyName)
Returns all the values from the violation's entries for the given property.
|
boolean |
removeListener(ViolationListener listener)
Removes the given listener from the list of listeners to be notified on specific events regarding the violation.
|
public Constraint getConstraint()
IViolation
getConstraint
in interface IViolation
public java.lang.String getMessage()
IViolation
getMessage
in interface IViolation
public java.util.Map<java.lang.String,java.lang.Object> getKeyObjects()
IViolation
getKeyObjects
in interface IViolation
public java.util.Set<IEntry> getEntries()
IViolation
getEntries
in interface IViolation
public java.util.Set<java.lang.Object> getValuesOfProperty(java.lang.String propertyName)
IViolation
getValuesOfProperty
in interface IViolation
propertyName
- The property's name for which the values should be returned.public java.util.Set<ViolationListener> getListeners()
IViolation
getListeners
in interface IViolation
public boolean addListener(ViolationListener listener)
IViolation
addListener
in interface IViolation
listener
- The listener to be registered.public boolean removeListener(ViolationListener listener)
IViolation
removeListener
in interface IViolation
listener
- The listener to be deregistered.true
if the listener was in fact registered.