Interface ConfigurationState
-
public interface ConfigurationStateContract between aConfigurationand aValidationProviderto create aValidatorFactory.The configuration artifacts defined in the XML configuration and provided to the
Configurationare merged and passed along viaConfigurationState.- Author:
- Emmanuel Bernard, Hardy Ferentschik, Gunnar Morling, Guillaume Smet
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ClockProvidergetClockProvider()Returns the clock provider for this configuration.ConstraintValidatorFactorygetConstraintValidatorFactory()Returns the constraint validator factory of this configuration.Set<InputStream>getMappingStreams()Returns a set of configuration streams.MessageInterpolatorgetMessageInterpolator()Returns the message interpolator of this configuration.ParameterNameProvidergetParameterNameProvider()Returns the parameter name provider for this configuration.Map<String,String>getProperties()Returns a map of non type-safe custom properties.TraversableResolvergetTraversableResolver()Returns the traversable resolver for this configuration.Set<ValueExtractor<?>>getValueExtractors()Returns a set of value extractors.booleanisIgnoreXmlConfiguration()ReturnstrueifConfiguration.ignoreXmlConfiguration()has been called.
-
-
-
Method Detail
-
isIgnoreXmlConfiguration
boolean isIgnoreXmlConfiguration()
ReturnstrueifConfiguration.ignoreXmlConfiguration()has been called.In this case, the
ValidatorFactorymust ignoreMETA-INF/validation.xml.- Returns:
trueifMETA-INF/validation.xmlshould be ignored
-
getMessageInterpolator
MessageInterpolator getMessageInterpolator()
Returns the message interpolator of this configuration.Message interpolator is defined in the following decreasing priority:
- set via the
Configurationprogrammatic API - defined in
META-INF/validation.xmlprovided thatignoreXmlConfigurationis false. In this case the instance is created via its no-arg constructor. nullif undefined.
- Returns:
- message interpolator instance or
nullif not defined
- set via the
-
getMappingStreams
Set<InputStream> getMappingStreams()
Returns a set of configuration streams.The streams are defined by:
- mapping XML streams passed programmatically in
Configuration - mapping XML streams located in the resources defined in
META-INF/validation.xml(constraint-mapping element)
Streams represented in the XML configuration and opened by the
Configurationimplementation must be closed by theConfigurationimplementation after theValidatorFactorycreation (or if an exception occurs). All streams are guaranteed to adhere to the mark/reset contract (seeInputStream.markSupported()by the Jakarta Bean Validation provider.- Returns:
- set of input stream
- mapping XML streams passed programmatically in
-
getValueExtractors
Set<ValueExtractor<?>> getValueExtractors()
Returns a set of value extractors.The extractors are retrieved from the following sources in decreasing order:
- extractors passed programmatically to
Configuration - extractors defined in
META-INF/validation.xmlprovided thatignoredXmlConfigurationisfalse - extractors loaded through the Java service loader
META-INF/validation.xmlor loaded through the service loader. Extractors defined inMETA-INF/validation.xmltake precedence over any extractor for the same type and type parameter loaded through the service loader.Extractors defined in
META-INF/validation.xmlor loaded through the service loader are instantiated using their no-arg constructor.- Returns:
- set of value extractors; may be empty but never
null - Since:
- 2.0
- extractors passed programmatically to
-
getConstraintValidatorFactory
ConstraintValidatorFactory getConstraintValidatorFactory()
Returns the constraint validator factory of this configuration.The
ConstraintValidatorFactoryimplementation is defined in the following decreasing priority:- set via the
Configurationprogrammatic API - defined in
META-INF/validation.xmlprovided thatignoredXmlConfigurationisfalse. In this case the instance is created via its no-arg constructor. nullif undefined.
- Returns:
- factory instance or
nullif not defined
- set via the
-
getTraversableResolver
TraversableResolver getTraversableResolver()
Returns the traversable resolver for this configuration.TraversableResolveris defined in the following decreasing priority:- set via the
Configurationprogrammatic API - defined in
META-INF/validation.xmlprovided thatignoredXmlConfigurationisfalse. In this case the instance is created via its no-arg constructor. nullif undefined.
- Returns:
- traversable resolver instance or
nullif not defined
- set via the
-
getParameterNameProvider
ParameterNameProvider getParameterNameProvider()
Returns the parameter name provider for this configuration.ParameterNameProvideris defined in the following decreasing priority:- set via the
Configurationprogrammatic API - defined in
META-INF/validation.xmlprovided thatignoreXmlConfigurationisfalse. In this case the instance is created via its no-arg constructor. nullif undefined.
- Returns:
- parameter name provider instance or
nullif not defined - Since:
- 1.1
- set via the
-
getClockProvider
ClockProvider getClockProvider()
Returns the clock provider for this configuration.ClockProvideris defined in the following decreasing priority:- set via the
Configurationprogrammatic API - defined in
META-INF/validation.xmlprovided thatignoreXmlConfigurationisfalse. In this case the instance is created via its no-arg constructor. nullif undefined.
- Returns:
- clock provider instance or
nullif not defined - Since:
- 2.0
- set via the
-
getProperties
Map<String,String> getProperties()
Returns a map of non type-safe custom properties.Properties defined via:
Configuration.addProperty(String, String)META-INF/validation.xmlprovided thatignoreXmlConfigurationisfalse.
If a property is defined both programmatically and in XML, the value defined programmatically has priority.
- Returns:
Mapwhose key is the property key and the value the property value
-
-