Package org.apache.bval.jsr
Class ConfigurationImpl
- java.lang.Object
-
- org.apache.bval.jsr.ConfigurationImpl
-
- All Implemented Interfaces:
jakarta.validation.Configuration<ApacheValidatorConfiguration>
,jakarta.validation.spi.ConfigurationState
,ApacheValidatorConfiguration
,CloseableAble
public class ConfigurationImpl extends Object implements ApacheValidatorConfiguration, jakarta.validation.spi.ConfigurationState, CloseableAble
Description: used to configure apache-validation for jsr. Implementation of Configuration that also implements ConfigurationState, hence this can be passed to buildValidatorFactory(ConfigurationState).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.bval.jsr.ApacheValidatorConfiguration
ApacheValidatorConfiguration.Properties
-
-
Constructor Summary
Constructors Constructor Description ConfigurationImpl(jakarta.validation.spi.BootstrapState aState, jakarta.validation.spi.ValidationProvider<ApacheValidatorConfiguration> aProvider)
Create a new ConfigurationImpl instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApacheValidatorConfiguration
addMapping(InputStream stream)
Add a stream describing constraint mapping in the Bean Validation XML format.ApacheValidatorConfiguration
addProperty(String name, String value)
Add a provider specific property.ApacheValidatorConfiguration
addValueExtractor(jakarta.validation.valueextraction.ValueExtractor<?> extractor)
jakarta.validation.ValidatorFactory
buildValidatorFactory()
main factory method to build a ValidatorFactoryApacheValidatorConfiguration
clockProvider(jakarta.validation.ClockProvider clockProvider)
ConfigurationImpl
constraintValidatorFactory(jakarta.validation.ConstraintValidatorFactory constraintValidatorFactory)
void
deferBootstrapOverrides()
jakarta.validation.BootstrapConfiguration
getBootstrapConfiguration()
jakarta.validation.ClockProvider
getClockProvider()
Closeable
getCloseable()
jakarta.validation.ConstraintValidatorFactory
getConstraintValidatorFactory()
jakarta.validation.ClockProvider
getDefaultClockProvider()
jakarta.validation.ConstraintValidatorFactory
getDefaultConstraintValidatorFactory()
jakarta.validation.MessageInterpolator
getDefaultMessageInterpolator()
jakarta.validation.ParameterNameProvider
getDefaultParameterNameProvider()
jakarta.validation.TraversableResolver
getDefaultTraversableResolver()
Set<InputStream>
getMappingStreams()
jakarta.validation.MessageInterpolator
getMessageInterpolator()
jakarta.validation.ParameterNameProvider
getParameterNameProvider()
Map<String,String>
getProperties()
Return a map of non type-safe custom properties.jakarta.validation.TraversableResolver
getTraversableResolver()
Set<jakarta.validation.valueextraction.ValueExtractor<?>>
getValueExtractors()
ApacheValidatorConfiguration
ignoreXmlConfiguration()
Ignore data from the META-INF/validation.xml file if this method is called.boolean
isIgnoreXmlConfiguration()
Returns true if Configuration.ignoreXMLConfiguration() has been called.ConfigurationImpl
messageInterpolator(jakarta.validation.MessageInterpolator resolver)
ApacheValidatorConfiguration
parameterNameProvider(jakarta.validation.ParameterNameProvider parameterNameProvider)
void
releaseDeferredBootstrapOverrides()
ApacheValidatorConfiguration
traversableResolver(jakarta.validation.TraversableResolver resolver)
-
-
-
Constructor Detail
-
ConfigurationImpl
public ConfigurationImpl(jakarta.validation.spi.BootstrapState aState, jakarta.validation.spi.ValidationProvider<ApacheValidatorConfiguration> aProvider)
Create a new ConfigurationImpl instance.- Parameters:
aState
- bootstrap stateaProvider
- provider
-
-
Method Detail
-
ignoreXmlConfiguration
public ApacheValidatorConfiguration ignoreXmlConfiguration()
Ignore data from the META-INF/validation.xml file if this method is called.- Specified by:
ignoreXmlConfiguration
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
- Returns:
- this
-
messageInterpolator
public ConfigurationImpl messageInterpolator(jakarta.validation.MessageInterpolator resolver)
- Specified by:
messageInterpolator
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
-
traversableResolver
public ApacheValidatorConfiguration traversableResolver(jakarta.validation.TraversableResolver resolver)
- Specified by:
traversableResolver
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
-
constraintValidatorFactory
public ConfigurationImpl constraintValidatorFactory(jakarta.validation.ConstraintValidatorFactory constraintValidatorFactory)
- Specified by:
constraintValidatorFactory
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
-
parameterNameProvider
public ApacheValidatorConfiguration parameterNameProvider(jakarta.validation.ParameterNameProvider parameterNameProvider)
- Specified by:
parameterNameProvider
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
-
clockProvider
public ApacheValidatorConfiguration clockProvider(jakarta.validation.ClockProvider clockProvider)
- Specified by:
clockProvider
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
-
addMapping
public ApacheValidatorConfiguration addMapping(InputStream stream)
Add a stream describing constraint mapping in the Bean Validation XML format.- Specified by:
addMapping
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
- Returns:
- this
-
addProperty
public ApacheValidatorConfiguration addProperty(String name, String value)
Add a provider specific property. This property is equivalent to XML configuration properties. If we do not know how to handle the property, we silently ignore it.- Specified by:
addProperty
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
- Returns:
- this
-
getDefaultMessageInterpolator
public jakarta.validation.MessageInterpolator getDefaultMessageInterpolator()
- Specified by:
getDefaultMessageInterpolator
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
-
getDefaultTraversableResolver
public jakarta.validation.TraversableResolver getDefaultTraversableResolver()
- Specified by:
getDefaultTraversableResolver
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
-
getDefaultConstraintValidatorFactory
public jakarta.validation.ConstraintValidatorFactory getDefaultConstraintValidatorFactory()
- Specified by:
getDefaultConstraintValidatorFactory
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
-
getDefaultParameterNameProvider
public jakarta.validation.ParameterNameProvider getDefaultParameterNameProvider()
- Specified by:
getDefaultParameterNameProvider
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
-
getDefaultClockProvider
public jakarta.validation.ClockProvider getDefaultClockProvider()
- Specified by:
getDefaultClockProvider
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
-
getProperties
public Map<String,String> getProperties()
Return a map of non type-safe custom properties.- Specified by:
getProperties
in interfacejakarta.validation.spi.ConfigurationState
- Returns:
- null
-
isIgnoreXmlConfiguration
public boolean isIgnoreXmlConfiguration()
Returns true if Configuration.ignoreXMLConfiguration() has been called. In this case, we ignore META-INF/validation.xml- Specified by:
isIgnoreXmlConfiguration
in interfacejakarta.validation.spi.ConfigurationState
- Returns:
- true
-
getMappingStreams
public Set<InputStream> getMappingStreams()
- Specified by:
getMappingStreams
in interfacejakarta.validation.spi.ConfigurationState
-
getMessageInterpolator
public jakarta.validation.MessageInterpolator getMessageInterpolator()
- Specified by:
getMessageInterpolator
in interfacejakarta.validation.spi.ConfigurationState
-
getBootstrapConfiguration
public jakarta.validation.BootstrapConfiguration getBootstrapConfiguration()
- Specified by:
getBootstrapConfiguration
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
-
buildValidatorFactory
public jakarta.validation.ValidatorFactory buildValidatorFactory()
main factory method to build a ValidatorFactory- Specified by:
buildValidatorFactory
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
- Throws:
jakarta.validation.ValidationException
- if the ValidatorFactory cannot be built
-
getConstraintValidatorFactory
public jakarta.validation.ConstraintValidatorFactory getConstraintValidatorFactory()
- Specified by:
getConstraintValidatorFactory
in interfacejakarta.validation.spi.ConfigurationState
- Returns:
- the constraint validator factory of this configuration.
-
getTraversableResolver
public jakarta.validation.TraversableResolver getTraversableResolver()
- Specified by:
getTraversableResolver
in interfacejakarta.validation.spi.ConfigurationState
-
getParameterNameProvider
public jakarta.validation.ParameterNameProvider getParameterNameProvider()
- Specified by:
getParameterNameProvider
in interfacejakarta.validation.spi.ConfigurationState
-
getClockProvider
public jakarta.validation.ClockProvider getClockProvider()
- Specified by:
getClockProvider
in interfacejakarta.validation.spi.ConfigurationState
-
addValueExtractor
public ApacheValidatorConfiguration addValueExtractor(jakarta.validation.valueextraction.ValueExtractor<?> extractor)
- Specified by:
addValueExtractor
in interfacejakarta.validation.Configuration<ApacheValidatorConfiguration>
-
getValueExtractors
public Set<jakarta.validation.valueextraction.ValueExtractor<?>> getValueExtractors()
- Specified by:
getValueExtractors
in interfacejakarta.validation.spi.ConfigurationState
-
deferBootstrapOverrides
public void deferBootstrapOverrides()
-
releaseDeferredBootstrapOverrides
public void releaseDeferredBootstrapOverrides()
-
getCloseable
public Closeable getCloseable()
- Specified by:
getCloseable
in interfaceCloseableAble
-
-