Package org.apache.bval.jsr
Class ApacheValidatorFactory
- java.lang.Object
-
- org.apache.bval.jsr.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 Summary
Constructors Constructor Description ApacheValidatorFactory(jakarta.validation.spi.ConfigurationState configuration)
Create a new ApacheValidatorFactory instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ApacheValidatorFactory
clone()
void
close()
AnnotationsManager
getAnnotationsManager()
Get theAnnotationsManager
.jakarta.validation.ClockProvider
getClockProvider()
ConstraintCached
getConstraintsCache()
Get the constraint cache used.jakarta.validation.ConstraintValidatorFactory
getConstraintValidatorFactory()
static ApacheValidatorFactory
getDefault()
Convenience method to retrieve a default global ApacheValidatorFactoryDescriptorManager
getDescriptorManager()
Get theDescriptorManager
.GroupsComputer
getGroupsComputer()
jakarta.validation.MessageInterpolator
getMessageInterpolator()
MetadataBuilders
getMetadataBuilders()
jakarta.validation.ParameterNameProvider
getParameterNameProvider()
Map<String,String>
getProperties()
Get the property map of thisApacheValidatorFactory
.jakarta.validation.TraversableResolver
getTraversableResolver()
Map<Class<?>,Class<?>>
getUnwrappedClassCache()
jakarta.validation.Validator
getValidator()
Shortcut method to create a new Validator instance with factory's settingsValueExtractors
getValueExtractors()
Get theValueExtractors
.void
setClockProvider(jakarta.validation.ClockProvider clockProvider)
void
setConstraintValidatorFactory(jakarta.validation.ConstraintValidatorFactory constraintValidatorFactory)
Set theConstraintValidatorFactory
used.static void
setDefault(ApacheValidatorFactory aDefaultFactory)
Set a particularApacheValidatorFactory
instance as the default.void
setMessageInterpolator(jakarta.validation.MessageInterpolator messageResolver)
Set theMessageInterpolator
used.void
setParameterNameProvider(jakarta.validation.ParameterNameProvider parameterNameProvider)
void
setTraversableResolver(jakarta.validation.TraversableResolver traversableResolver)
Set theTraversableResolver
used.<T> T
unwrap(Class<T> type)
Return an object of the specified type to allow access to the provider-specific API.ApacheFactoryContext
usingContext()
-
-
-
Method Detail
-
getDefault
public static ApacheValidatorFactory getDefault()
Convenience method to retrieve a default global ApacheValidatorFactory- Returns:
ApacheValidatorFactory
-
setDefault
public static void setDefault(ApacheValidatorFactory aDefaultFactory)
Set a particularApacheValidatorFactory
instance as the default.- Parameters:
aDefaultFactory
-
-
getProperties
public Map<String,String> getProperties()
Get the property map of thisApacheValidatorFactory
.- Returns:
- Map
-
getValidator
public jakarta.validation.Validator getValidator()
Shortcut method to create a new Validator instance with factory's settings- Specified by:
getValidator
in interfacejakarta.validation.ValidatorFactory
- Returns:
- the new validator instance
-
usingContext
public ApacheFactoryContext usingContext()
- Specified by:
usingContext
in interfacejakarta.validation.ValidatorFactory
- Returns:
- the validator factory's context
-
clone
public ApacheValidatorFactory clone()
-
setMessageInterpolator
public final void setMessageInterpolator(jakarta.validation.MessageInterpolator messageResolver)
Set theMessageInterpolator
used.- Parameters:
messageResolver
-
-
getMessageInterpolator
public jakarta.validation.MessageInterpolator getMessageInterpolator()
- Specified by:
getMessageInterpolator
in interfacejakarta.validation.ValidatorFactory
-
setTraversableResolver
public final void setTraversableResolver(jakarta.validation.TraversableResolver traversableResolver)
Set theTraversableResolver
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 interfacejakarta.validation.ValidatorFactory
-
setConstraintValidatorFactory
public final void setConstraintValidatorFactory(jakarta.validation.ConstraintValidatorFactory constraintValidatorFactory)
Set theConstraintValidatorFactory
used.- Parameters:
constraintValidatorFactory
-
-
getConstraintValidatorFactory
public jakarta.validation.ConstraintValidatorFactory getConstraintValidatorFactory()
- Specified by:
getConstraintValidatorFactory
in interfacejakarta.validation.ValidatorFactory
-
getParameterNameProvider
public jakarta.validation.ParameterNameProvider getParameterNameProvider()
- Specified by:
getParameterNameProvider
in interfacejakarta.validation.ValidatorFactory
-
getClockProvider
public jakarta.validation.ClockProvider getClockProvider()
- Specified by:
getClockProvider
in interfacejakarta.validation.ValidatorFactory
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfacejakarta.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 interfacejakarta.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.
-
getConstraintsCache
public ConstraintCached getConstraintsCache()
Get the constraint cache used.- Returns:
ConstraintCached
-
getAnnotationsManager
public AnnotationsManager getAnnotationsManager()
Get theAnnotationsManager
.- Returns:
AnnotationsManager
-
getDescriptorManager
public DescriptorManager getDescriptorManager()
Get theDescriptorManager
.- Returns:
DescriptorManager
-
getValueExtractors
public ValueExtractors getValueExtractors()
Get theValueExtractors
.- Returns:
ValueExtractors
-
getMetadataBuilders
public MetadataBuilders getMetadataBuilders()
-
getGroupsComputer
public GroupsComputer getGroupsComputer()
-
-