- Enclosing interface:
Validator
public static interface Validator.Builder
Build the Validator instance adding ValidationAdapter, Factory or AdapterBuilder.
-
Method Summary
Modifier and TypeMethodDescriptionadd
(ValidationContext.AdapterFactory factory) Add a ValidationAdapter.Factory which provides ValidationAdapters to use.add
(ValidationContext.AnnotationFactory factory) Add a ValidationAdapter.Factory which provides ValidationAdapters to use.add
(ValidatorCustomizer component) Add a Component which can provide multiple ValidationAdapters and or configuration.add
(Class<? extends Annotation> type, ValidationAdapter<T> adapter) Add a AnnotationValidationAdapter to use for the given type.add
(Class<? extends Annotation> type, Validator.AnnotationAdapterBuilder builder) Add a AdapterBuilder which provides a Annotation ValidationAdapter to use for the given type.add
(Type type, ValidationAdapter<T> adapter) Add a ValidationAdapter to use for the given type.add
(Type type, Validator.AdapterBuilder builder) Add a AdapterBuilder which provides a ValidationAdapter to use for the given type.addLocales
(Locale... locales) Adds additional Locales for this validatoraddResourceBundles
(String... bundleName) Lookup ResourceBundles with the given names for error message interpolation.addResourceBundles
(ResourceBundle... bundle) Add ResourceBundles for error message interpolationbuild()
Build and return the Validator instance with all the given adapters and factories registered.clockProvider
(Supplier<Clock> clockSupplier) Contract for obtaining the Clock used as the reference for now when validating the@Future
and@Past
constraints.failFast
(boolean failFast) Enable/Disable fail fast mode.messageInterpolator
(MessageInterpolator interpolator) Set the MessageInterpolator that will be used to parse and interpolate error messagessetDefaultLocale
(Locale defaultLocale) Set Default Locale for this validator.temporalTolerance
(Duration temporalTolerance) Define the acceptable margin of error when comparing date/time in temporal constraints.
-
Method Details
-
add
Add a ValidationAdapter to use for the given type. -
add
Add a AnnotationValidationAdapter to use for the given type. -
addResourceBundles
Lookup ResourceBundles with the given names for error message interpolation. This will attempt to load the bundles for every locale configured with this builder -
addResourceBundles
Add ResourceBundles for error message interpolation -
setDefaultLocale
Set Default Locale for this validator. If not set, will use Locale.getDefault() -
addLocales
Adds additional Locales for this validator -
clockProvider
Contract for obtaining the Clock used as the reference for now when validating the@Future
and@Past
constraints. -
temporalTolerance
Define the acceptable margin of error when comparing date/time in temporal constraints. -
messageInterpolator
Set the MessageInterpolator that will be used to parse and interpolate error messages -
failFast
Enable/Disable fail fast mode. When fail fast is enabled the validation will stop on the first constraint violation detected. -
add
Add a AdapterBuilder which provides a ValidationAdapter to use for the given type. -
add
Add a AdapterBuilder which provides a Annotation ValidationAdapter to use for the given type. -
add
Add a Component which can provide multiple ValidationAdapters and or configuration. -
add
Add a ValidationAdapter.Factory which provides ValidationAdapters to use. -
add
Add a ValidationAdapter.Factory which provides ValidationAdapters to use. -
build
Validator build()Build and return the Validator instance with all the given adapters and factories registered.
-