public abstract class AbstractMethodValidationInterceptor 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.
| Modifier and Type | Field and Description |
|---|---|
(package private) javax.validation.Validator |
validator
The validator to be used for method validation.
|
| Constructor and Description |
|---|
AbstractMethodValidationInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
validateConstructorInvocation(javax.interceptor.InvocationContext ctx)
Validates the Bean Validation constraints specified at the parameters and/or
return value of the intercepted constructor.
|
protected Object |
validateMethodInvocation(javax.interceptor.InvocationContext ctx)
Validates the Bean Validation constraints specified at the parameters and/or
return value of the intercepted method.
|
@Inject javax.validation.Validator validator
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.
protected Object validateMethodInvocation(javax.interceptor.InvocationContext ctx) throws Exception
ctx - The context of the intercepted method invocation.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.protected void validateConstructorInvocation(javax.interceptor.InvocationContext ctx)
throws Exception
ctx - The context of the intercepted constructor invocation.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 © 2021 JBoss by Red Hat. All rights reserved.