Class ValidatingInterceptor

java.lang.Object
io.micronaut.validation.ValidatingInterceptor
All Implemented Interfaces:
io.micronaut.aop.Interceptor<Object,Object>, io.micronaut.aop.MethodInterceptor<Object,Object>, io.micronaut.core.order.Ordered

@Singleton public class ValidatingInterceptor extends Object implements io.micronaut.aop.MethodInterceptor<Object,Object>
A MethodInterceptor that validates method invocations.
Since:
1.0
Author:
Graeme Rocher
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The position of the interceptor.

    Fields inherited from interface io.micronaut.aop.Interceptor

    ARGUMENT, CACHEABLE_LAZY_TARGET, HOTSWAP, LAZY, PROXY_TARGET

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    ValidatingInterceptor(@Nullable Validator micronautValidator, @Nullable jakarta.validation.ValidatorFactory validatorFactory, io.micronaut.core.convert.ConversionService conversionService)
    Creates ValidatingInterceptor from the validatorFactory.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    @Nullable Object
    intercept(io.micronaut.aop.MethodInvocationContext<Object,Object> context)
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface io.micronaut.aop.MethodInterceptor

    intercept
  • Field Details

    • POSITION

      public static final int POSITION
      The position of the interceptor. See Ordered
  • Constructor Details

    • ValidatingInterceptor

      public ValidatingInterceptor(@Nullable @Nullable Validator micronautValidator, @Nullable @Nullable jakarta.validation.ValidatorFactory validatorFactory, io.micronaut.core.convert.ConversionService conversionService)
      Creates ValidatingInterceptor from the validatorFactory.
      Parameters:
      micronautValidator - The micronaut validator use if no factory is available
      validatorFactory - Factory returning initialized Validator instances
      conversionService - The conversion service
  • Method Details

    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface io.micronaut.core.order.Ordered
    • intercept

      @Nullable public @Nullable Object intercept(io.micronaut.aop.MethodInvocationContext<Object,Object> context)
      Specified by:
      intercept in interface io.micronaut.aop.MethodInterceptor<Object,Object>