Package org.appng.api
Interface ValidationProvider
-
- All Known Subinterfaces:
Request
- All Known Implementing Classes:
ApplicationRequest
,DefaultValidationProvider
public interface ValidationProvider
Provides some validation-related methods.- Author:
- Matthias Müller
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addValidationMetaData(MetaData metaData, ClassLoader classLoader, Class<?>... groups)
Based on the JSR-303 annotations of theMetaData
's bindclass, this method adds theValidation
to theFieldDef
initions.void
validateBean(Object bean, FieldProcessor fieldProcessor, Class<?>... groups)
Validates the given bean by adding error-messages to theFieldDef
initions, usingFieldProcessor.addErrorMessage(FieldDef, String)
.void
validateBean(Object bean, FieldProcessor fieldProcessor, String[] excludeBindings, Class<?>... groups)
Validates the given bean by adding error-messages to theFieldDef
initions, usingFieldProcessor.addErrorMessage(FieldDef, String)
.void
validateField(Object bean, FieldProcessor fieldProcessor, String fieldBinding, Class<?>... groups)
Validates a singleFieldDef
by adding error-messages to it, usingFieldProcessor.addErrorMessage(FieldDef, String)
.
-
-
-
Method Detail
-
validateBean
void validateBean(Object bean, FieldProcessor fieldProcessor, Class<?>... groups)
Validates the given bean by adding error-messages to theFieldDef
initions, usingFieldProcessor.addErrorMessage(FieldDef, String)
.- Parameters:
bean
- the bean to validatefieldProcessor
- theFieldProcessor
containing theMetaData
for the beangroups
- the JSR-303 validation groups to use- See Also:
FieldProcessor.addErrorMessage(FieldDef, String)
-
validateBean
void validateBean(Object bean, FieldProcessor fieldProcessor, String[] excludeBindings, Class<?>... groups)
Validates the given bean by adding error-messages to theFieldDef
initions, usingFieldProcessor.addErrorMessage(FieldDef, String)
.- Parameters:
bean
- the bean to validatefieldProcessor
- theFieldProcessor
containing theMetaData
for the beanexcludeBindings
- an array of field-bindings to ignore during validationgroups
- the JSR-303 validation groups to use- See Also:
FieldProcessor.addErrorMessage(FieldDef, String)
-
validateField
void validateField(Object bean, FieldProcessor fieldProcessor, String fieldBinding, Class<?>... groups)
Validates a singleFieldDef
by adding error-messages to it, usingFieldProcessor.addErrorMessage(FieldDef, String)
.- Parameters:
bean
- the bean to validatefieldProcessor
- theFieldProcessor
containing theMetaData
for the beanfieldBinding
- the binding of theFieldDef
to validategroups
- the JSR-303 validation groups to use- See Also:
FieldProcessor.addErrorMessage(FieldDef, String)
-
addValidationMetaData
void addValidationMetaData(MetaData metaData, ClassLoader classLoader, Class<?>... groups) throws ClassNotFoundException
Based on the JSR-303 annotations of theMetaData
's bindclass, this method adds theValidation
to theFieldDef
initions.- Parameters:
metaData
- theMetaData
to add theValidation
s toclassLoader
- theClassLoader
to load theMetaData
s bindClassgroups
- the JSR-303 validation groups to use- Throws:
ClassNotFoundException
- if the bindClass can not be loaded- See Also:
Min
,Max
,Size
,Digits
,NotNull
,Future
,Past
,Type
,Pattern
,FileUpload
-
-