|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.townleyenterprises.validator.BasicFormValidator
This class is a bean which provides a basic implementation of a form validator which will perform the validations in the correct order.
Constructor Summary | |
BasicFormValidator()
Basic constructor |
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 simply deferrs to the validate(Form,Locale) method. |
void |
validate(Form form,
java.util.Locale locale)
This method performs the validations in the default order according to the order specified in the interface. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BasicFormValidator()
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.
getAbortOnFailure
in interface FormValidator
public void setAbortOnFailure(boolean val)
setAbortOnFailure
in interface FormValidator
val
- the value of the flagpublic void validate(Form form) throws java.lang.Exception
validate(Form,Locale)
method.
validate
in interface FormValidator
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
abortOnFailure
property, this method
throws an exception.
validate
in interface FormValidator
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)
FormValidator
addFieldValidator
in interface FormValidator
name
- the field namevalidator
- the validator instancepublic void removeFieldValidator(FieldValidator validator)
FormValidator
removeFieldValidator
in interface FormValidator
validator
- the validator to removepublic void addFieldSetValidator(FieldSetValidator validator)
FormValidator
addFieldSetValidator
in interface FormValidator
validator
- the validator to addpublic void removeFieldSetValidator(FieldSetValidator validator)
FormValidator
removeFieldSetValidator
in interface FormValidator
validator
- the validator to removepublic FieldValidator[] getFieldValidators()
FormValidator
getFieldValidators
in interface FormValidator
public FieldSetValidator[] getFieldSetValidators()
FormValidator
getFieldSetValidators
in interface FormValidator
public void addValidationListener(ValidationListener listener)
addValidationListener
in interface FormValidator
public void removeValidationListener(ValidationListener listener)
removeValidationListener
in interface FormValidator
public ValidationListener[] getValidationListeners()
getValidationListeners
in interface FormValidator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |