org.hibernate.validator.internal.cdi.interceptor

## Class ValidationInterceptor

- java.lang.Object
- - org.hibernate.validator.internal.cdi.interceptor.ValidationInterceptor

- All Implemented Interfaces:
    Serializable

      @Interceptor
      @Priority(value=4800)
      public class ValidationInterceptor
      extends Object
      implements Serializable

  An interceptor which performs a validation of the Bean Validation constraints specified at the parameters and/or return values of intercepted methods using the method validation functionality provided by Hibernate Validator.
  Author:
    Gunnar Morling, Hardy Ferentschik
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ValidationInterceptor()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `validateConstructorInvocation(InvocationContext ctx)` Validates the Bean Validation constraints specified at the parameters and/or return value of the intercepted constructor.
    `Object` | `validateMethodInvocation(InvocationContext ctx)` Validates the Bean Validation constraints specified at the parameters and/or return value of the intercepted method.

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

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

- - ### Constructor Detail

    - #### ValidationInterceptor

          public ValidationInterceptor()

  - ### Method Detail

    - #### validateMethodInvocation

          public Object validateMethodInvocation(InvocationContext ctx)
                                          throws Exception

      Validates the Bean Validation constraints specified at the parameters and/or return value of the intercepted method.
      Parameters:
        `ctx` - The context of the intercepted method invocation.
      Returns:
        The result of the method invocation.
      Throws:
        `Exception` - Any exception caused by the intercepted method invocation. A `ConstraintViolationException` in case at least one constraint violation occurred either during parameter or return value validation.

    - #### validateConstructorInvocation

          public void validateConstructorInvocation(InvocationContext ctx)
                                             throws Exception

      Validates the Bean Validation constraints specified at the parameters and/or return value of the intercepted constructor.
      Parameters:
        `ctx` - The context of the intercepted constructor invocation.
      Throws:
        `Exception` - Any exception caused by the intercepted constructor invocation. A `ConstraintViolationException` in case at least one constraint violation occurred either during parameter or return value validation.

Copyright © 2007-2014 Red Hat, Inc. All Rights Reserved