org.eclipse.incquery.validation.core

## Class Violation

- java.lang.Object
- - org.eclipse.incquery.validation.core.Violation

- All Implemented Interfaces:
    IViolation

      public class Violation
      extends java.lang.Object
      implements IViolation

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Violation()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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.

    - #### 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.

    - #### 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.

    - #### 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.