Class AbstractMethodValidationInterceptor

    • Field Detail

      • validator

        @Inject
        javax.validation.Validator validator
        The validator to be used for method validation.

        Although the concrete validator is not necessarily serializable (and HV's implementation indeed isn't) it is still alright to have it as non-transient field here. Upon passivation not the validator itself will be serialized, but the proxy injected here, which in turn is serializable.

    • Constructor Detail

      • AbstractMethodValidationInterceptor

        public AbstractMethodValidationInterceptor()
    • Method Detail

      • validateMethodInvocation

        protected Object validateMethodInvocation​(javax.interceptor.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

        protected void validateConstructorInvocation​(javax.interceptor.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.