Package org.apache.wicket.bean.validation
This package integrates bean validation framework into Wicket.
The integration is configured using BeanValidationConfiguration. Usually this is done in Application's init method. Once the configuration is intialized and customized, the final step is to call configure passing in the application instance to be configured.
The configuration can be customized using the following integration points:
IPropertyResolver
- used to automatically figure out which property is being validated given the form component instance. By default all components using an IPropertyReflectionAwareModel are supported.IViolationTranslator
- converts bean validation constraint violations to Wicket validation errors that are reported on form components when validation fails.ITagModifier
- An object that can modify the form component's markup tag. Can be used to add html attributes to tags based on constaint annotations.Provider<Validator>
- used as a factory for the main Validator object instance that will be used to perform the validation
Once the application is configured form components can be validated by adding a PropertyValidator.
-
Interface Summary Interface Description BeanValidationContext A read-only view ofBeanValidationConfiguration
that can be retrieved by components to access the validator and other helpers.IPropertyResolver Resolves the property to be validated for the given form component.ITagModifier<T extends Annotation> An object that can modify a component's markup tag during render based on values of a constraint annotation.IViolationTranslator ConvertsConstraintViolation
s into Wicket'sValidationError
s -
Class Summary Class Description BeanValidationConfiguration Configures bean validation and integrates it with WicketDefaultPropertyResolver Default property resolver.DefaultValidatorProvider This is the default validator provider.DefaultViolationTranslator A default implementation ofIViolationTranslator
.GroupsModel A model that can hold on to an array of classes.Property A reference to a property that can be validated.PropertyValidator<T> Validator that delegates to the bean validation framework.SessionLocaleInterpolator MessageInterpolator
that adapts another to a locale from Wicket'sSession
SizeTagModifier A tag modifier that adds themaxlength
andminlength
attributes to theinput
andtextarea
tag with the max/min value from theSize
constraint annotation.