Interface GeneralValidator

  • All Known Subinterfaces:
    GeneralValidatorCDI

    public interface GeneralValidator
    Version:
    $Revision: 1.1 $ Javadoc adapted from javax.validation.Validator and javax.validation.executable.ExecutableValidator:
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void checkViolations​(HttpRequest request)
      Throws a ResteasyViolationException if any validation violations have been detected.
      boolean isMethodValidatable​(java.lang.reflect.Method method)
      Indicates if validation is turned on for a method.
      boolean isValidatable​(java.lang.Class<?> clazz)
      Indicates if validation is turned on for a class.
      void validate​(HttpRequest request, java.lang.Object object, java.lang.Class<?>... groups)
      Validates all constraints on object.
      void validateAllParameters​(HttpRequest request, java.lang.Object object, java.lang.reflect.Method method, java.lang.Object[] parameterValues, java.lang.Class<?>... groups)
      Validates all constraints placed on the parameters of the given method.
      void validateReturnValue​(HttpRequest request, java.lang.Object object, java.lang.reflect.Method method, java.lang.Object returnValue, java.lang.Class<?>... groups)
      Validates all return value constraints of the given method.
    • Method Detail

      • validate

        void validate​(HttpRequest request,
                      java.lang.Object object,
                      java.lang.Class<?>... groups)
        Validates all constraints on object.
        Parameters:
        object - object to validate
        groups - the group or list of groups targeted for validation (defaults to Default)
        Throws:
        java.lang.IllegalArgumentException - if object is null or if null is passed to the varargs groups
        ValidationException - if a non recoverable error happens during the validation process
      • validateAllParameters

        void validateAllParameters​(HttpRequest request,
                                   java.lang.Object object,
                                   java.lang.reflect.Method method,
                                   java.lang.Object[] parameterValues,
                                   java.lang.Class<?>... groups)
        Validates all constraints placed on the parameters of the given method.
        Type Parameters:
        T - the type hosting the method to validate
        Parameters:
        object - the object on which the method to validate is invoked
        method - the method for which the parameter constraints is validated
        parameterValues - the values provided by the caller for the given method's parameters
        groups - the group or list of groups targeted for validation (defaults to Default)
        Throws:
        java.lang.IllegalArgumentException - if null is passed for any of the parameters or if parameters don't match with each other
        ValidationException - if a non recoverable error happens during the validation process
      • validateReturnValue

        void validateReturnValue​(HttpRequest request,
                                 java.lang.Object object,
                                 java.lang.reflect.Method method,
                                 java.lang.Object returnValue,
                                 java.lang.Class<?>... groups)
        Validates all return value constraints of the given method.
        Type Parameters:
        T - the type hosting the method to validate
        Parameters:
        object - the object on which the method to validate is invoked
        method - the method for which the return value constraints is validated
        returnValue - the value returned by the given method
        groups - the group or list of groups targeted for validation (defaults to Default)
        Throws:
        java.lang.IllegalArgumentException - if null is passed for any of the object, method or groups parameters or if parameters don't match with each other
        ValidationException - if a non recoverable error happens during the validation process
      • isValidatable

        boolean isValidatable​(java.lang.Class<?> clazz)
        Indicates if validation is turned on for a class.
        Parameters:
        clazz - Class to be examined
        Returns:
        true if and only if validation is turned on for clazz
      • isMethodValidatable

        boolean isMethodValidatable​(java.lang.reflect.Method method)
        Indicates if validation is turned on for a method.
        Parameters:
        method - method to be examined
        Returns:
        true if and only if validation is turned on for method
      • checkViolations

        void checkViolations​(HttpRequest request)
        Throws a ResteasyViolationException if any validation violations have been detected.
        Parameters:
        request -