Class Violation

  • All Implemented Interfaces:
    IViolation

    public class Violation
    extends java.lang.Object
    implements IViolation
    • Constructor Detail

      • Violation

        public Violation()
    • Method Detail

      • getConstraint

        public Constraint getConstraint()
        Description copied from interface: IViolation
        Returns the constraint for which the violation appeared.
        Specified by:
        getConstraint in interface IViolation
        Returns:
        The constraint.
      • setConstraint

        protected void setConstraint​(Constraint constraint)
      • getMessage

        public java.lang.String getMessage()
        Description copied from interface: IViolation
        Returns the message of the violation generated from the format message of the constraint specification and the key objects.
        Specified by:
        getMessage in interface IViolation
        Returns:
        The message.
      • setMessage

        protected void setMessage​(java.lang.String message)
      • getKeyObjects

        public java.util.Map<java.lang.String,​java.lang.Object> getKeyObjects()
        Description copied from interface: IViolation
        Returns the key objects Map of the violation, which serves as a unique key of the violation.
        Specified by:
        getKeyObjects in interface IViolation
        Returns:
        The key objects Map, containing the parameters names and values as key value pairs.
      • setKeyObjects

        protected void setKeyObjects​(java.util.Map<java.lang.String,​java.lang.Object> keyObjects)
      • removeMatch

        protected boolean removeMatch​(IPatternMatch match)
      • getEntries

        public java.util.Set<IEntry> getEntries()
        Description copied from interface: IViolation
        Returns the entries for each pattern match witch corresponds to the violation.
        Specified by:
        getEntries in interface IViolation
        Returns:
        The Set of entries, each representing a pattern match for the violation.
      • getValuesOfProperty

        public java.util.Set<java.lang.Object> getValuesOfProperty​(java.lang.String propertyName)
        Description copied from interface: IViolation
        Returns all the values from the violation's entries for the given property.
        Specified by:
        getValuesOfProperty in interface IViolation
        Parameters:
        propertyName - The property's name for which the values should be returned.
        Returns:
        The Set of values for the requested property.
      • getListeners

        public java.util.Set<ViolationListener> getListeners()
        Description copied from interface: IViolation
        Returns the listeners registered for the violation.
        Specified by:
        getListeners in interface IViolation
        Returns:
        The Collection of listeners registered for the violation.
      • addListener

        public boolean addListener​(ViolationListener listener)
        Description copied from interface: IViolation
        Adds the given listener to the list of listeners to be notified on specific events regarding the violation.
        Specified by:
        addListener in interface IViolation
        Parameters:
        listener - The listener to be registered.
      • removeListener

        public boolean removeListener​(ViolationListener listener)
        Description copied from interface: IViolation
        Removes the given listener from the list of listeners to be notified on specific events regarding the violation.
        Specified by:
        removeListener in interface IViolation
        Parameters:
        listener - The listener to be deregistered.
        Returns:
        true if the listener was in fact registered.
      • notifyListenersViolationEntryAppeared

        protected void notifyListenersViolationEntryAppeared​(IPatternMatch match)
      • notifyListenersViolationMessageUpdated

        protected void notifyListenersViolationMessageUpdated()
      • notifyListenersViolationEntryDisappeared

        protected void notifyListenersViolationEntryDisappeared​(IPatternMatch match)