|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object toolbox.web.validation.ValidatorImpl
public class ValidatorImpl
Default validator implementation that takes the form configurations from an XML configuration file.
Field Summary | |
---|---|
static java.util.ArrayList |
NUMBER_TYPES
Contains a list of supported number wrappers. |
static java.lang.String |
THOUSANDS_SEPARATOR
Thousands separator replaced when validating numbers. |
Constructor Summary | |
---|---|
ValidatorImpl()
Default constructor. |
Method Summary | |
---|---|
java.util.List |
getFields(java.lang.String form)
Implemented to comply with interface definition. |
java.util.ResourceBundle |
getResource(java.util.Locale locale)
Implemented to comply with interface definition. |
void |
init(java.lang.String name,
XMLProperties xmlProps)
Initialise all configured forms and place them in the forms map. |
java.util.Map |
validate(java.lang.String formName,
javax.servlet.ServletRequest request)
Validates the given request and returns a map of validated values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String THOUSANDS_SEPARATOR
public static final java.util.ArrayList NUMBER_TYPES
Constructor Detail |
---|
public ValidatorImpl()
Method Detail |
---|
public void init(java.lang.String name, XMLProperties xmlProps) throws ValidationException
init
in interface Validator
name
- Name of this validator.xmlProps
- XML configuration properties.
ValidationException
- if configured forms cannot be initialised.public java.util.Map validate(java.lang.String formName, javax.servlet.ServletRequest request) throws ValidationException
This implementation steps thru a map of FormField instances and tries to validate each field instance with the value obtained from the given SerlvetRequest.
validate
in interface Validator
formName
- Name of the form to validate.request
- Serlvet request containing form data.
ValidationException
- if the request could not be validated.public java.util.ResourceBundle getResource(java.util.Locale locale) throws ValidationException
getResource
in interface Validator
locale
- Locale to use. May be null.
ValidationException
- if the resource cannot be obtained.public java.util.List getFields(java.lang.String form)
getFields
in interface Validator
form
- String containing form grouping name.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |