Constructor and Description |
---|
ApacheValidatorFactory(javax.validation.spi.ConfigurationState configuration)
Create a new ApacheValidatorFactory instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addDefaultSequence(Class<?> beanClass,
Class<?>... groupSequence)
Set the default group sequence for a particular bean class.
|
void |
addMetaConstraint(Class<?> beanClass,
MetaConstraint<?,?> metaConstraint)
Add a meta-constraint to this
ApacheValidatorFactory 's runtime
customizations. |
void |
addValid(Class<?> beanClass,
AccessStrategy accessStrategy)
Mark a property of
beanClass for nested validation. |
protected MetaBeanFinder |
buildMetaBeanFinder()
Create MetaBeanManager that uses factories:
if enabled by
ApacheValidatorConfiguration.Properties.ENABLE_INTROSPECTOR , an
IntrospectorMetaBeanFactory
MetaBeanFactory types (if any) specified by
ApacheValidatorConfiguration.Properties.METABEAN_FACTORY_CLASSNAMES
if no JsrMetaBeanFactory has yet been specified (this
allows factory order customization), a JsrMetaBeanFactory
which handles both JSR303-XML and JSR303-Annotations
if enabled by
ApacheValidatorConfiguration.Properties.ENABLE_METABEANS_XML , an
XMLMetaBeanFactory
|
ApacheValidatorFactory |
clone() |
void |
close() |
protected MetaBeanFinder |
createMetaBeanManager(List<MetaBeanFactory> builders)
Create a
MetaBeanManager using the specified builders. |
AnnotationIgnores |
getAnnotationIgnores()
Get the detected
AnnotationIgnores . |
ConstraintCached |
getConstraintsCache()
Get the constraint cache used.
|
javax.validation.ConstraintValidatorFactory |
getConstraintValidatorFactory() |
static ApacheValidatorFactory |
getDefault()
Convenience method to retrieve a default global ApacheValidatorFactory
|
ConstraintDefaults |
getDefaultConstraints()
Get the detected
ConstraintDefaults . |
Class<?>[] |
getDefaultSequence(Class<?> beanClass)
Get the default group sequence configured for
beanClass . |
javax.validation.MessageInterpolator |
getMessageInterpolator() |
<T> List<MetaConstraint<T,? extends Annotation>> |
getMetaConstraints(Class<T> beanClass)
Retrieve the runtime constraint configuration for a given class.
|
javax.validation.ParameterNameProvider |
getParameterNameProvider() |
Map<String,String> |
getProperties()
Get the property map of this
ApacheValidatorFactory . |
javax.validation.TraversableResolver |
getTraversableResolver() |
List<AccessStrategy> |
getValidAccesses(Class<?> beanClass)
Get the
AccessStrategy List indicating nested bean
validations that must be triggered in the course of validating a
beanClass graph. |
javax.validation.Validator |
getValidator()
Shortcut method to create a new Validator instance with factory's
settings
|
void |
setConstraintValidatorFactory(javax.validation.ConstraintValidatorFactory constraintValidatorFactory)
Set the
ConstraintValidatorFactory used. |
static void |
setDefault(ApacheValidatorFactory aDefaultFactory)
Set a particular
ApacheValidatorFactory instance as the default. |
void |
setMessageInterpolator(javax.validation.MessageInterpolator messageResolver)
Set the
MessageInterpolator used. |
void |
setParameterNameProvider(javax.validation.ParameterNameProvider parameterNameProvider) |
void |
setTraversableResolver(javax.validation.TraversableResolver traversableResolver)
Set the
TraversableResolver used. |
<T> T |
unwrap(Class<T> type)
Return an object of the specified type to allow access to the
provider-specific API.
|
ApacheFactoryContext |
usingContext() |
public ApacheValidatorFactory(javax.validation.spi.ConfigurationState configuration)
protected MetaBeanFinder buildMetaBeanFinder()
ApacheValidatorConfiguration.Properties.ENABLE_INTROSPECTOR
, an
IntrospectorMetaBeanFactory
MetaBeanFactory
types (if any) specified by
ApacheValidatorConfiguration.Properties.METABEAN_FACTORY_CLASSNAMES
JsrMetaBeanFactory
has yet been specified (this
allows factory order customization), a JsrMetaBeanFactory
which handles both JSR303-XML and JSR303-AnnotationsApacheValidatorConfiguration.Properties.ENABLE_METABEANS_XML
, an
XMLMetaBeanFactory
public static ApacheValidatorFactory getDefault()
ApacheValidatorFactory
public static void setDefault(ApacheValidatorFactory aDefaultFactory)
ApacheValidatorFactory
instance as the default.aDefaultFactory
- public Map<String,String> getProperties()
ApacheValidatorFactory
.public javax.validation.Validator getValidator()
getValidator
in interface javax.validation.ValidatorFactory
public ApacheFactoryContext usingContext()
usingContext
in interface javax.validation.ValidatorFactory
public ApacheValidatorFactory clone()
public final void setMessageInterpolator(javax.validation.MessageInterpolator messageResolver)
MessageInterpolator
used.messageResolver
- public javax.validation.MessageInterpolator getMessageInterpolator()
getMessageInterpolator
in interface javax.validation.ValidatorFactory
public final void setTraversableResolver(javax.validation.TraversableResolver traversableResolver)
TraversableResolver
used.traversableResolver
- public void setParameterNameProvider(javax.validation.ParameterNameProvider parameterNameProvider)
public javax.validation.TraversableResolver getTraversableResolver()
getTraversableResolver
in interface javax.validation.ValidatorFactory
public final void setConstraintValidatorFactory(javax.validation.ConstraintValidatorFactory constraintValidatorFactory)
ConstraintValidatorFactory
used.constraintValidatorFactory
- public javax.validation.ConstraintValidatorFactory getConstraintValidatorFactory()
getConstraintValidatorFactory
in interface javax.validation.ValidatorFactory
public javax.validation.ParameterNameProvider getParameterNameProvider()
getParameterNameProvider
in interface javax.validation.ValidatorFactory
public void close()
close
in interface javax.validation.ValidatorFactory
public <T> T unwrap(Class<T> type)
unwrap
in interface javax.validation.ValidatorFactory
type
- the class of the object to be returned.javax.validation.ValidationException
- if the provider does not support the call.public ConstraintDefaults getDefaultConstraints()
ConstraintDefaults
.public AnnotationIgnores getAnnotationIgnores()
AnnotationIgnores
.public ConstraintCached getConstraintsCache()
ConstraintCached
public void addMetaConstraint(Class<?> beanClass, MetaConstraint<?,?> metaConstraint)
ApacheValidatorFactory
's runtime
customizations.beanClass
- metaConstraint
- public void addValid(Class<?> beanClass, AccessStrategy accessStrategy)
beanClass
for nested validation.beanClass
- accessStrategy
- defining the property to validatepublic void addDefaultSequence(Class<?> beanClass, Class<?>... groupSequence)
beanClass
- groupSequence
- public <T> List<MetaConstraint<T,? extends Annotation>> getMetaConstraints(Class<T> beanClass)
T
- beanClass
- MetaConstraint
s applicable to
beanClass
public List<AccessStrategy> getValidAccesses(Class<?> beanClass)
AccessStrategy
List
indicating nested bean
validations that must be triggered in the course of validating a
beanClass
graph.beanClass
- List
of AccessStrategy
public Class<?>[] getDefaultSequence(Class<?> beanClass)
beanClass
.beanClass
- protected MetaBeanFinder createMetaBeanManager(List<MetaBeanFactory> builders)
MetaBeanManager
using the specified builders.builders
- MetaBeanFactory
List
MetaBeanManager
Copyright © 2010–2016 The Apache Software Foundation. All rights reserved.