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()
IViolationgetConstraint in interface IViolationprotected void setConstraint(Constraint constraint)
public java.lang.String getMessage()
IViolationgetMessage in interface IViolationprotected void setMessage(java.lang.String message)
public java.util.Map<java.lang.String,java.lang.Object> getKeyObjects()
IViolationgetKeyObjects in interface IViolationprotected 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()
IViolationgetEntries in interface IViolationpublic java.util.Set<java.lang.Object> getValuesOfProperty(java.lang.String propertyName)
IViolationgetValuesOfProperty in interface IViolationpropertyName - The property's name for which the values should be returned.public java.util.Set<ViolationListener> getListeners()
IViolationgetListeners in interface IViolationpublic boolean addListener(ViolationListener listener)
IViolationaddListener in interface IViolationlistener - The listener to be registered.public boolean removeListener(ViolationListener listener)
IViolationremoveListener in interface IViolationlistener - 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)