|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines the validation functionality of a form as a whole. Each form has three different levels of validation which is possible:
Based on previous projects, this kind of granularity is necessary to fully encapsulate all of the possible kinds of form validation done in the real world.
The default order of the validations will be the following unless explicitly changed (and documented) by implementing classes.
Method Summary | |
void |
addFieldSetValidator(FieldSetValidator validator)
This method is used to add a new field set validator |
void |
addFieldValidator(java.lang.String name,
FieldValidator validator)
This method is used to add a new validator for a specific field of the form. |
void |
addValidationListener(ValidationListener listener)
|
boolean |
getAbortOnFailure()
This method is used to determine the mode of the form validator. |
FieldSetValidator[] |
getFieldSetValidators()
This method returns the currently configured field set validators as an array. |
FieldValidator[] |
getFieldValidators()
This method returns the currently configured field validators as an array. |
ValidationListener[] |
getValidationListeners()
|
void |
removeFieldSetValidator(FieldSetValidator validator)
This method is used to remove a new field set validator |
void |
removeFieldValidator(FieldValidator validator)
This method is used to remove a specific validator instance. |
void |
removeValidationListener(ValidationListener listener)
|
void |
setAbortOnFailure(boolean val)
This method is used to set the validation mode of the form. |
void |
validate(Form form)
This method will perform the validation of the supplied form according to the standard order or an implementation-defined order as documented by the specific implementation. |
void |
validate(Form form,
java.util.Locale locale)
This method performs the same validation as the validate(com.townleyenterprises.validator.Form) method except for taking a specific locale
rather than using the default. |
Method Detail |
public boolean getAbortOnFailure()
false
, the validator
will attempt to perform all of the registered validations
once and notify the listeners of any failures. If it
returns true
, the validation operation will
stop after the first validation failure.
public void setAbortOnFailure(boolean val)
val
- the value of the flagpublic void validate(Form form) throws java.lang.Exception
form
- the form to validate
java.lang.Exception
- if any of the validations failpublic void validate(Form form, java.util.Locale locale) throws java.lang.Exception
validate(com.townleyenterprises.validator.Form)
method except for taking a specific locale
rather than using the default.
form
- the form to validatelocale
- the specific locale to use
java.lang.Exception
- if any of the validations failpublic void addFieldValidator(java.lang.String name, FieldValidator validator)
name
- the field namevalidator
- the validator instancepublic void removeFieldValidator(FieldValidator validator)
validator
- the validator to removepublic void addFieldSetValidator(FieldSetValidator validator)
validator
- the validator to addpublic void removeFieldSetValidator(FieldSetValidator validator)
validator
- the validator to removepublic FieldValidator[] getFieldValidators()
public FieldSetValidator[] getFieldSetValidators()
public void addValidationListener(ValidationListener listener)
public void removeValidationListener(ValidationListener listener)
public ValidationListener[] getValidationListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |