Class DefaultValidatorConfiguration

java.lang.Object
io.micronaut.validation.validator.DefaultValidatorConfiguration
All Implemented Interfaces:
io.micronaut.core.convert.ConversionServiceAware, io.micronaut.core.convert.ConversionServiceProvider, io.micronaut.core.util.Toggleable, ValidatorConfiguration, jakarta.validation.ValidatorContext

@ConfigurationProperties("micronaut.validator") public class DefaultValidatorConfiguration extends Object implements ValidatorConfiguration, io.micronaut.core.util.Toggleable, jakarta.validation.ValidatorContext, io.micronaut.core.convert.ConversionServiceAware
The default configuration for the validator.
Since:
1.2
Author:
graemerocher
  • Constructor Details

    • DefaultValidatorConfiguration

      public DefaultValidatorConfiguration()
  • Method Details

    • setConversionService

      @Inject public void setConversionService(io.micronaut.core.convert.ConversionService conversionService)
      Sets the conversion service.
      Specified by:
      setConversionService in interface io.micronaut.core.convert.ConversionServiceAware
      Parameters:
      conversionService - The conversion service
    • getConversionService

      public io.micronaut.core.convert.ConversionService getConversionService()
      Specified by:
      getConversionService in interface io.micronaut.core.convert.ConversionServiceProvider
    • getConstraintValidatorRegistry

      @NonNull public @NonNull ConstraintValidatorRegistry getConstraintValidatorRegistry()
      Specified by:
      getConstraintValidatorRegistry in interface ValidatorConfiguration
      Returns:
      The constraint registry to use.
    • getConstraintValidatorFactory

      public jakarta.validation.ConstraintValidatorFactory getConstraintValidatorFactory()
      Specified by:
      getConstraintValidatorFactory in interface ValidatorConfiguration
      Returns:
      The constraint factory to use.
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface io.micronaut.core.util.Toggleable
    • setEnabled

      public DefaultValidatorConfiguration setEnabled(boolean enabled)
      Sets whether Micronaut's validator is enabled.
      Parameters:
      enabled - True if it is
      Returns:
      this configuration
    • setConstraintValidatorRegistry

      @Inject public DefaultValidatorConfiguration setConstraintValidatorRegistry(@Nullable @Nullable ConstraintValidatorRegistry constraintValidatorRegistry)
      Sets the constraint validator registry to use.
      Parameters:
      constraintValidatorRegistry - The registry to use
      Returns:
      this configuration
    • getValueExtractorRegistry

      @NonNull public @NonNull ValueExtractorRegistry getValueExtractorRegistry()
      Specified by:
      getValueExtractorRegistry in interface ValidatorConfiguration
      Returns:
      The value extractor registry
    • setValueExtractorRegistry

      @Inject public DefaultValidatorConfiguration setValueExtractorRegistry(@Nullable @Nullable ValueExtractorRegistry valueExtractorRegistry)
      Sets the value extractor registry use.
      Parameters:
      valueExtractorRegistry - The registry
      Returns:
      this configuration
    • getClockProvider

      @NonNull public @NonNull jakarta.validation.ClockProvider getClockProvider()
      Specified by:
      getClockProvider in interface ValidatorConfiguration
      Returns:
      The clock provider
    • getDefaultClockProvider

      public jakarta.validation.ClockProvider getDefaultClockProvider()
      Specified by:
      getDefaultClockProvider in interface ValidatorConfiguration
      Returns:
      The default clock provider
    • setClockProvider

      @Inject public DefaultValidatorConfiguration setClockProvider(@Nullable @Nullable jakarta.validation.ClockProvider clockProvider)
      Sets the clock provider to use.
      Parameters:
      clockProvider - The clock provider
      Returns:
      this configuration
    • getDefaultTraversableResolver

      @NonNull public @NonNull jakarta.validation.TraversableResolver getDefaultTraversableResolver()
      Specified by:
      getDefaultTraversableResolver in interface ValidatorConfiguration
      Returns:
      The default traversable resolver to use
    • getTraversableResolver

      @NonNull public @NonNull jakarta.validation.TraversableResolver getTraversableResolver()
      Specified by:
      getTraversableResolver in interface ValidatorConfiguration
      Returns:
      The traversable resolver to use
    • setTraversableResolver

      @Inject public DefaultValidatorConfiguration setTraversableResolver(@Nullable @Nullable jakarta.validation.TraversableResolver traversableResolver)
      Sets the traversable resolver to use.
      Parameters:
      traversableResolver - The resolver
      Returns:
      This configuration
    • getMessageInterpolator

      @NonNull public @NonNull jakarta.validation.MessageInterpolator getMessageInterpolator()
      Specified by:
      getMessageInterpolator in interface ValidatorConfiguration
      Returns:
      The message interpolator
    • getDefaultMessageInterpolator

      @NonNull public @NonNull jakarta.validation.MessageInterpolator getDefaultMessageInterpolator()
      Specified by:
      getDefaultMessageInterpolator in interface ValidatorConfiguration
      Returns:
      The default message interpolator
    • setMessageInterpolator

      @Inject public DefaultValidatorConfiguration setMessageInterpolator(@Nullable @Nullable jakarta.validation.MessageInterpolator messageInterpolator)
      Sets the message interpolator to use.
      Parameters:
      messageInterpolator - The message interpolator
      Returns:
      this configuration
    • getExecutionHandleLocator

      @NonNull public @NonNull io.micronaut.context.ExecutionHandleLocator getExecutionHandleLocator()
      Description copied from interface: ValidatorConfiguration
      The execution handler locator to use.
      Specified by:
      getExecutionHandleLocator in interface ValidatorConfiguration
      Returns:
      The locator
    • setExecutionHandleLocator

      @Inject public DefaultValidatorConfiguration setExecutionHandleLocator(@Nullable @Nullable io.micronaut.context.BeanContext beanContext)
      Sets the execution handler locator to use.
      Parameters:
      beanContext - The beanContext
      Returns:
      this configuration
    • messageInterpolator

      public jakarta.validation.ValidatorContext messageInterpolator(jakarta.validation.MessageInterpolator messageInterpolator)
      Specified by:
      messageInterpolator in interface jakarta.validation.ValidatorContext
    • traversableResolver

      public jakarta.validation.ValidatorContext traversableResolver(jakarta.validation.TraversableResolver traversableResolver)
      Specified by:
      traversableResolver in interface jakarta.validation.ValidatorContext
    • constraintValidatorFactory

      public jakarta.validation.ValidatorContext constraintValidatorFactory(jakarta.validation.ConstraintValidatorFactory factory)
      Specified by:
      constraintValidatorFactory in interface jakarta.validation.ValidatorContext
    • parameterNameProvider

      public jakarta.validation.ValidatorContext parameterNameProvider(jakarta.validation.ParameterNameProvider parameterNameProvider)
      Specified by:
      parameterNameProvider in interface jakarta.validation.ValidatorContext
    • clockProvider

      public jakarta.validation.ValidatorContext clockProvider(jakarta.validation.ClockProvider clockProvider)
      Specified by:
      clockProvider in interface jakarta.validation.ValidatorContext
    • addValueExtractor

      public jakarta.validation.ValidatorContext addValueExtractor(jakarta.validation.valueextraction.ValueExtractor<?> extractor)
      Specified by:
      addValueExtractor in interface jakarta.validation.ValidatorContext
    • getValidator

      public jakarta.validation.Validator getValidator()
      Specified by:
      getValidator in interface jakarta.validation.ValidatorContext
    • getBeanIntrospector

      public io.micronaut.core.beans.BeanIntrospector getBeanIntrospector()
      Description copied from interface: ValidatorConfiguration
      The bean introspector.
      Specified by:
      getBeanIntrospector in interface ValidatorConfiguration
      Returns:
      The introspector
    • setBeanIntrospector

      public final void setBeanIntrospector(io.micronaut.core.beans.BeanIntrospector beanIntrospector)
    • getClassFromType

      public static Class<?> getClassFromType(Type type)