@Singleton public class ValidatingInterceptor extends java.lang.Object implements MethodInterceptor<java.lang.Object,java.lang.Object>
MethodInterceptor that validates method invocations.| Modifier and Type | Field and Description |
|---|---|
static int |
POSITION
The position of the interceptor.
|
HOTSWAP, LAZY, PROXY_TARGETHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
ValidatingInterceptor(Validator micronautValidator,
javax.validation.ValidatorFactory validatorFactory)
Creates ValidatingInterceptor from the validatorFactory.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getOrder() |
java.lang.Object |
intercept(MethodInvocationContext<java.lang.Object,java.lang.Object> context)
Extended version of the
MethodInterceptor.intercept(InvocationContext) method that accepts a MethodInvocationContext. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinterceptpublic static final int POSITION
Orderedpublic ValidatingInterceptor(@Nullable
Validator micronautValidator,
@Nullable
javax.validation.ValidatorFactory validatorFactory)
micronautValidator - The micronaut validator use if no factory is availablevalidatorFactory - Factory returning initialized Validator instancespublic int getOrder()
public java.lang.Object intercept(MethodInvocationContext<java.lang.Object,java.lang.Object> context)
MethodInterceptorMethodInterceptor.intercept(InvocationContext) method that accepts a MethodInvocationContext.intercept in interface MethodInterceptor<java.lang.Object,java.lang.Object>context - The context