org.jboss.resteasy.spi.validation

## Interface GeneralValidatorCDI

- All Superinterfaces:
    GeneralValidator
  All Known Implementing Classes:
    GeneralValidatorImpl, GeneralValidatorImpl

      public interface GeneralValidatorCDI
      extends GeneralValidator

  Version:
    $Revision: 1.1 $ If CDI is enabled, validation will be invoked from an interceptor, rather than from ResourceMethodInvoker and MethodInjectorImpl. Copyright Feb 12, 2014
  Author:
    Ron Sigal

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkForConstraintViolations(HttpRequest request, Exception e)` Throws a ResteasyViolationException if either a ConstraintViolationException or a ResteasyConstraintViolationException is embedded in the cause hierarchy of e.
    `void` | `checkViolationsfromCDI(HttpRequest request)` Throws a ResteasyViolationException if any validation violations have been detected.
    `boolean` | `isValidatable(Class<?> clazz, InjectorFactory injectorFactory)` Indicates if validation is turned on for a class.
    `boolean` | `isValidatableFromCDI(Class<?> clazz)` Indicates if validation is turned on for a class.

    - ### Methods inherited from interface org.jboss.resteasy.spi.validation.GeneralValidator

      `checkViolations, isMethodValidatable, isValidatable, validate, validateAllParameters, validateReturnValue`

- - ### Method Detail

    - #### isValidatable

          boolean isValidatable(Class<?> clazz,
                              InjectorFactory injectorFactory)

      Indicates if validation is turned on for a class. This method should be called from the resteasy-jaxrs module. It should test if injectorFactor is an instance of CdiInjectorFactory, which indicates that CDI is active. If so, it should return false. Otherwise, it should return the same value returned by GeneralValidator.isValidatable().
      Parameters:
        `clazz` - Class to be examined
        `injectorFactory` - the InjectorFactory used for clazz
      Returns:
        true if and only if validation is turned on for clazz

    - #### isValidatableFromCDI

          boolean isValidatableFromCDI(Class<?> clazz)

      Indicates if validation is turned on for a class. This method should be called only from the resteasy-cdi module.
      Parameters:
        `clazz` - Class to be examined
      Returns:
        true if and only if validation is turned on for clazz

    - #### checkViolationsfromCDI

          void checkViolationsfromCDI(HttpRequest request)

      Throws a ResteasyViolationException if any validation violations have been detected. The method should be called only from the resteasy-cdi module.
      Parameters:
        `request` -

    - #### checkForConstraintViolations

          void checkForConstraintViolations(HttpRequest request,
                                          Exception e)

      Throws a ResteasyViolationException if either a ConstraintViolationException or a ResteasyConstraintViolationException is embedded in the cause hierarchy of e.
      Parameters:
        `request` -
        `e` -

Copyright © 2014. All Rights Reserved.