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