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.
|
protected boolean |
addMatch(IPatternMatch match) |
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.
|
protected java.util.Map<ViolationKey,IPatternMatch> |
getMatches() |
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.
|
protected void |
notifyListenersViolationEntryAppeared(IPatternMatch match) |
protected void |
notifyListenersViolationEntryDisappeared(IPatternMatch match) |
protected void |
notifyListenersViolationMessageUpdated() |
boolean |
removeListener(ViolationListener listener)
Removes the given listener from the list of listeners to be notified on specific events regarding the violation.
|
protected boolean |
removeMatch(IPatternMatch match) |
protected void |
setConstraint(Constraint constraint) |
protected void |
setKeyObjects(java.util.Map<java.lang.String,java.lang.Object> keyObjects) |
protected void |
setMessage(java.lang.String message) |
public Constraint getConstraint()
IViolation
getConstraint
in interface IViolation
protected void setConstraint(Constraint constraint)
public java.lang.String getMessage()
IViolation
getMessage
in interface IViolation
protected void setMessage(java.lang.String message)
public java.util.Map<java.lang.String,java.lang.Object> getKeyObjects()
IViolation
getKeyObjects
in interface IViolation
protected void setKeyObjects(java.util.Map<java.lang.String,java.lang.Object> keyObjects)
protected java.util.Map<ViolationKey,IPatternMatch> getMatches()
protected boolean addMatch(IPatternMatch match)
protected boolean removeMatch(IPatternMatch match)
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.protected void notifyListenersViolationEntryAppeared(IPatternMatch match)
protected void notifyListenersViolationMessageUpdated()
protected void notifyListenersViolationEntryDisappeared(IPatternMatch match)