nl.gx.webmanager.handler.forms.validation
Class ElfCheckFormPartValidator
java.lang.Object
nl.gx.webmanager.handler.forms.validation.ElfCheckFormPartValidator
- All Implemented Interfaces:
- FormComponent, Validator
public class ElfCheckFormPartValidator
- extends java.lang.Object
- implements Validator
Performs an 'elfproef' ('eleven check') on the formpart to check if it could be a valid Dutch bank account number. This check also prevents acceptance of bank account numbers where two digits are switched, which is a common typing mistake.
Note: For Dutch postal bank account (Postbank) numbers there is no check. All numbers below 100.000.000 could be postal bank account numbers.
| Variable |
Type |
Mode |
Default |
Description |
| wmformpart |
Parameter |
Required |
- |
The formpart to validate (a bank account number). |
| invalid |
Message |
- |
- |
If the formpart value did not pass the 'Elfproef'. |
Example usage:
- Check if number could be a Dutch bank account number.
|
Field Summary |
static java.lang.String |
INVALID
|
|
Method Summary |
void |
init(FormComponentConfig c)
Passes the initialization parameters to the component. |
ValidatorMessage[] |
validate(FormDefinition form,
State formState,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Performs validation on a form and returns an array of validator
messages, containing errors detected in the submitted values. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INVALID
public static final java.lang.String INVALID
- See Also:
- Constant Field Values
ElfCheckFormPartValidator
public ElfCheckFormPartValidator()
init
public void init(FormComponentConfig c)
throws InitializationException
- Description copied from interface:
FormComponent
- Passes the initialization parameters to the component.
- Specified by:
init in interface FormComponent
- Parameters:
c - The FormComponentConfig object that contains
configutation information for this component.
- Throws:
InitializationException - If initialization failed
validate
public ValidatorMessage[] validate(FormDefinition form,
State formState,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
- Description copied from interface:
Validator
- Performs validation on a form and returns an array of validator
messages, containing errors detected in the submitted values.
- Specified by:
validate in interface Validator
- Parameters:
form - The form that should be validatedformState - The object representing the state of the formflow.
This object provides access to values submitted by the client and
the exceptions and validator messages for the form.req - The http servlet requestres - The http servlet response
- Returns:
- The array of validator messages, containing validation errors for the form.
Copyright © 2007-2011 GX Software BV. All Rights Reserved.