public class BeanValidationConfiguration extends Object implements BeanValidationContext
Constructor and Description |
---|
BeanValidationConfiguration() |
Modifier and Type | Method and Description |
---|---|
BeanValidationConfiguration |
add(IPropertyResolver resolver)
Adds a property resolver to the configuration.
|
void |
configure(Application application)
Binds this configuration to the application instance
|
static BeanValidationContext |
get()
Retrieves the validation context (read only version of the configuration).
|
<T extends Annotation> |
getTagModifier(Class<T> annotationType)
Gets the tag modifier for the specified annotation type
|
javax.validation.Validator |
getValidator() |
IViolationTranslator |
getViolationTranslator() |
boolean |
isRequiredConstraint(javax.validation.metadata.ConstraintDescriptor<?> constraint)
By default
NotNull and NotEmpty constraints make a component required. |
<T extends Annotation> |
register(Class<T> annotationType,
ITagModifier<T> modifier)
Registeres a tag modifier for a specific constraint annotation
|
Property |
resolveProperty(FormComponent<?> component)
Resolve the property for a component.
|
void |
setValidatorProvider(Supplier<javax.validation.Validator> validatorProvider)
Sets the provider used to retrieve
Validator instances |
void |
setViolationTranslator(IViolationTranslator violationTranslator)
Registers a violation translator
|
public <T extends Annotation> BeanValidationConfiguration register(Class<T> annotationType, ITagModifier<T> modifier)
annotationType
- constraint annotation such as Size
modifier
- tag modifier to usethis
public <T extends Annotation> ITagModifier<T> getTagModifier(Class<T> annotationType)
BeanValidationContext
getTagModifier
in interface BeanValidationContext
null
if nonepublic BeanValidationConfiguration add(IPropertyResolver resolver)
resolver
- this
public javax.validation.Validator getValidator()
getValidator
in interface BeanValidationContext
public void setValidatorProvider(Supplier<javax.validation.Validator> validatorProvider)
Validator
instancesvalidatorProvider
- public void configure(Application application)
application
- public IViolationTranslator getViolationTranslator()
getViolationTranslator
in interface BeanValidationContext
public void setViolationTranslator(IViolationTranslator violationTranslator)
violationTranslator
- A violation translator that will convert ConstraintViolation
s into Wicket's
ValidationError
spublic static BeanValidationContext get()
public Property resolveProperty(FormComponent<?> component)
BeanValidationContext
resolveProperty
in interface BeanValidationContext
resolveProperty
in interface IPropertyResolver
component
- componentpublic boolean isRequiredConstraint(javax.validation.metadata.ConstraintDescriptor<?> constraint)
NotNull
and NotEmpty
constraints make a component required.isRequiredConstraint
in interface BeanValidationContext
constraint
- constrainttrue
if requiredCopyright © 2006–2022 Apache Software Foundation. All rights reserved.