org.eclipse.incquery.validation.core

## Class ValidationEngine

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

- All Implemented Interfaces:
    IValidationEngine

      public class ValidationEngine
      extends java.lang.Object
      implements IValidationEngine

  This class uses an `IncQueryEngine` for tracking violations of `ConstraintSpecification`s. Use the `builder()` method for setting up a new instance through the `ValidationEngineBuilder`.
  Author:
    Abel Hegedus

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ValidationEngine(org.eclipse.emf.common.notify.Notifier notifier, org.apache.log4j.Logger logger)` Deprecated. use `ValidationEngineBuilder` instead.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `IConstraint` | `addConstraintSpecification(IConstraintSpecification constraintSpecification)` Adds the given constraint specification to the validation engine and returns the created constraint.
    `boolean` | `addListener(ValidationEngineListener listener)` Adds the given listener to the list of listeners to be notified on specific events regarding the validation engine.
    `static ValidationEngineBuilder` | `builder()`
    `void` | `dispose()` Disposes the validation engine.
    `java.util.Set<IConstraint>` | `getConstraints()` Returns the constraints to the registered constraint specifications.
    `java.util.Set<ValidationEngineListener>` | `getListeners()` Returns the listeners registered for the validation engine.
    `void` | `initialize()` Initializes the validation engine.
    `IConstraint` | `removeConstraintSpecification(IConstraintSpecification constraintSpecification)` Removes the given constraint specification from the validation engine and returns the corresponding constraint.
    `boolean` | `removeListener(ValidationEngineListener listener)` Removes the given listener from the list of listeners to be notified on specific events regarding the validation engine.

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

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

- - ### Constructor Detail

    - #### ValidationEngine

          public ValidationEngine(org.eclipse.emf.common.notify.Notifier notifier,
                                  org.apache.log4j.Logger logger)

      Deprecated. use `ValidationEngineBuilder` instead.
      Creates a new validation engine initialized on a managed `IncQueryEngine` with the given Notifier as scope and with the given Logger.
      Parameters:
        `notifier` -
        `logger` -
      Throws:
        `java.lang.IllegalArgumentException` - if either argument is null

  - ### Method Detail

    - #### builder

          public static ValidationEngineBuilder builder()

    - #### initialize

          public void initialize()

      Description copied from interface: `IValidationEngine`
      Initializes the validation engine.
      Specified by:
        `initialize` in interface `IValidationEngine`

    - #### dispose

          public void dispose()

      Description copied from interface: `IValidationEngine`
      Disposes the validation engine.
      Specified by:
        `dispose` in interface `IValidationEngine`

    - #### getConstraints

          public java.util.Set<IConstraint> getConstraints()

      Description copied from interface: `IValidationEngine`
      Returns the constraints to the registered constraint specifications.
      Specified by:
        `getConstraints` in interface `IValidationEngine`
      Returns:
        The Collection of constraints in the validation engine.

    - #### addConstraintSpecification

          public IConstraint addConstraintSpecification(IConstraintSpecification constraintSpecification)

      Description copied from interface: `IValidationEngine`
      Adds the given constraint specification to the validation engine and returns the created constraint.
      Specified by:
        `addConstraintSpecification` in interface `IValidationEngine`
      Parameters:
        `constraintSpecification` - The constraint specification instance to be registered.
      Returns:
        The created corresponding constraint instance.

    - #### removeConstraintSpecification

          public IConstraint removeConstraintSpecification(IConstraintSpecification constraintSpecification)

      Description copied from interface: `IValidationEngine`
      Removes the given constraint specification from the validation engine and returns the corresponding constraint.
      Specified by:
        `removeConstraintSpecification` in interface `IValidationEngine`
      Parameters:
        `constraintSpecification` - The constraint specification to be deregistered.
      Returns:
        The removed corresponding constraint instance.

    - #### getListeners

          public java.util.Set<ValidationEngineListener> getListeners()

      Description copied from interface: `IValidationEngine`
      Returns the listeners registered for the validation engine.
      Specified by:
        `getListeners` in interface `IValidationEngine`
      Returns:
        The Collection of listeners registered for the validation engine.

    - #### addListener

          public boolean addListener(ValidationEngineListener listener)

      Description copied from interface: `IValidationEngine`
      Adds the given listener to the list of listeners to be notified on specific events regarding the validation engine.
      Specified by:
        `addListener` in interface `IValidationEngine`
      Parameters:
        `listener` - The listener to be registered.
      Returns:
        `true` if the listener was not registered before.

    - #### removeListener

          public boolean removeListener(ValidationEngineListener listener)

      Description copied from interface: `IValidationEngine`
      Removes the given listener from the list of listeners to be notified on specific events regarding the validation engine.
      Specified by:
        `removeListener` in interface `IValidationEngine`
      Parameters:
        `listener` - The listener to be deregistered.
      Returns:
        `true` if the listener was in fact registered.