Package org.appng.api
Interface FormValidator
-
public interface FormValidator
Interface that can be implemented by anActionProvider
or the formBean that is used by anActionProvider
. AFormValidator
is used for contextual validation, e.g. to verify that one value is greater than the other or that two given passwords match. For all other basic validations, use JSR-380 (Bean Validtion 2.0) annotations.
Thevalidate()
-method is being called before theActionProvider
sperform
-method. Only if there are no errors (seeFieldProcessor.hasErrors()
), theActionProvider
is being actually called.- Author:
- Matthias Müller
- See Also:
ActionProvider.perform(Site, Application, Environment, Options, Request, Object, FieldProcessor)
,FieldProcessor.hasErrors()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
validate(Site site, Application application, Environment environment, Options options, Request request, FieldProcessor fieldProcessor)
This method validates the givenRequest
and eventually adds someMessage
s to theFieldProcessor
using one of itsaddErrorMessage()
-methods.
-
-
-
Method Detail
-
validate
void validate(Site site, Application application, Environment environment, Options options, Request request, FieldProcessor fieldProcessor)
This method validates the givenRequest
and eventually adds someMessage
s to theFieldProcessor
using one of itsaddErrorMessage()
-methods.- Parameters:
site
- the currentSite
application
- the currentApplication
environment
- the currentEnvironment
options
- theOptions
for thisDataProvider
request
- the currentRequest
fieldProcessor
- theFieldProcessor
containing all readableFieldDef
initions for the DataProvider- See Also:
FieldProcessor.addErrorMessage(String)
,FieldProcessor.addErrorMessage(FieldDef, String)
-
-