Class ApacheValidatorFactory

  • All Implemented Interfaces:
    jakarta.validation.ValidatorFactory, AutoCloseable, Cloneable

    public class ApacheValidatorFactory
    extends Object
    implements jakarta.validation.ValidatorFactory, Cloneable
    Description: a factory is a complete configurated object that can create validators.
    This instance is not thread-safe.
    • Constructor Detail

      • ApacheValidatorFactory

        public ApacheValidatorFactory​(jakarta.validation.spi.ConfigurationState configuration)
        Create a new ApacheValidatorFactory instance.
    • Method Detail

      • getUnwrappedClassCache

        public Map<Class<?>,​Class<?>> getUnwrappedClassCache()
      • getValidator

        public jakarta.validation.Validator getValidator()
        Shortcut method to create a new Validator instance with factory's settings
        Specified by:
        getValidator in interface jakarta.validation.ValidatorFactory
        Returns:
        the new validator instance
      • usingContext

        public ApacheFactoryContext usingContext()
        Specified by:
        usingContext in interface jakarta.validation.ValidatorFactory
        Returns:
        the validator factory's context
      • setMessageInterpolator

        public final void setMessageInterpolator​(jakarta.validation.MessageInterpolator messageResolver)
        Set the MessageInterpolator used.
        Parameters:
        messageResolver -
      • getMessageInterpolator

        public jakarta.validation.MessageInterpolator getMessageInterpolator()
        Specified by:
        getMessageInterpolator in interface jakarta.validation.ValidatorFactory
      • setTraversableResolver

        public final void setTraversableResolver​(jakarta.validation.TraversableResolver traversableResolver)
        Set the TraversableResolver used.
        Parameters:
        traversableResolver -
      • setParameterNameProvider

        public void setParameterNameProvider​(jakarta.validation.ParameterNameProvider parameterNameProvider)
      • setClockProvider

        public void setClockProvider​(jakarta.validation.ClockProvider clockProvider)
      • getTraversableResolver

        public jakarta.validation.TraversableResolver getTraversableResolver()
        Specified by:
        getTraversableResolver in interface jakarta.validation.ValidatorFactory
      • setConstraintValidatorFactory

        public final void setConstraintValidatorFactory​(jakarta.validation.ConstraintValidatorFactory constraintValidatorFactory)
        Set the ConstraintValidatorFactory used.
        Parameters:
        constraintValidatorFactory -
      • getConstraintValidatorFactory

        public jakarta.validation.ConstraintValidatorFactory getConstraintValidatorFactory()
        Specified by:
        getConstraintValidatorFactory in interface jakarta.validation.ValidatorFactory
      • getParameterNameProvider

        public jakarta.validation.ParameterNameProvider getParameterNameProvider()
        Specified by:
        getParameterNameProvider in interface jakarta.validation.ValidatorFactory
      • getClockProvider

        public jakarta.validation.ClockProvider getClockProvider()
        Specified by:
        getClockProvider in interface jakarta.validation.ValidatorFactory
      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface jakarta.validation.ValidatorFactory
      • unwrap

        public <T> T unwrap​(Class<T> type)
        Return an object of the specified type to allow access to the provider-specific API. If the Bean Validation provider implementation does not support the specified class, the ValidationException is thrown.
        Specified by:
        unwrap in interface jakarta.validation.ValidatorFactory
        Parameters:
        type - the class of the object to be returned.
        Returns:
        an instance of the specified class
        Throws:
        jakarta.validation.ValidationException - if the provider does not support the call.