public interface HibernateValidatorConfiguration extends Configuration<HibernateValidatorConfiguration>
Modifier and Type | Field and Description |
---|---|
static String |
FAIL_FAST
Property corresponding to the
failFast(boolean) method. |
Modifier and Type | Method and Description |
---|---|
HibernateValidatorConfiguration |
addMapping(ConstraintMapping mapping)
Adds the specified
ConstraintMapping instance to the configuration. |
ConstraintMapping |
createConstraintMapping()
Creates a new constraint mapping which can be used to programmatically configure the constraints for given types.
|
HibernateValidatorConfiguration |
failFast(boolean failFast)
En- or disables the fail fast mode.
|
ResourceBundleLocator |
getDefaultResourceBundleLocator()
Returns the
ResourceBundleLocator used by the
default message
interpolator to load user-provided resource bundles. |
addMapping, addProperty, buildValidatorFactory, constraintValidatorFactory, getDefaultConstraintValidatorFactory, getDefaultMessageInterpolator, getDefaultTraversableResolver, ignoreXmlConfiguration, messageInterpolator, traversableResolver
static final String FAIL_FAST
ResourceBundleLocator getDefaultResourceBundleLocator()
Returns the ResourceBundleLocator
used by the
default message
interpolator
to load user-provided resource bundles. In conformance with
the specification this default locator retrieves the bundle
"ValidationMessages".
This locator can be used as delegate for custom locators when setting a
customized ResourceBundleMessageInterpolator
:
HibernateValidatorConfiguration configure =
Validation.byProvider(HibernateValidator.class).configure();
ResourceBundleLocator defaultResourceBundleLocator =
configure.getDefaultBundleLocator();
ResourceBundleLocator myResourceBundleLocator =
new MyResourceBundleLocator(defaultResourceBundleLocator);
configure.messageInterpolator(
new ResourceBundleMessageInterpolator(myResourceBundleLocator));
Deprecation note: The return type of this method will change to
ResourceBundleLocator
in a future release.
The return value of this method should be assigned to a variable of this type.
ResourceBundleLocator
. Never null.ConstraintMapping createConstraintMapping()
addMapping(ConstraintMapping)
.HibernateValidatorConfiguration addMapping(ConstraintMapping mapping)
ConstraintMapping
instance to the configuration. Constraints configured in mapping
will be added to the constraints configured via annotations and/or xml.mapping
- ConstraintMapping
instance containing programmatic configured constraintsthis
following the chaining method patternIllegalArgumentException
- if mapping
is null
HibernateValidatorConfiguration failFast(boolean failFast)
failFast
- true
to enable fail fast, false
otherwise.this
following the chaining method patternCopyright © 2007-2014 Red Hat Middleware, LLC. All Rights Reserved