|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.formproc.validation.Validator
Base class for all validators. Validators must implement the
validate()
method to provide validation logic.
Field Summary | |
protected FormManager |
formManager
|
protected MessageProvider |
messageProvider
|
protected java.util.Map |
properties
|
Constructor Summary | |
Validator()
Construct a new Validator. |
Method Summary | |
java.lang.Object |
clone()
Clone the validator. |
void |
configure(com.anthonyeden.lib.config.Configuration configuration)
Configure the validator using the given configuration object. |
void |
configureInternal(com.anthonyeden.lib.config.Configuration configuration)
Implementations can override this method to configure themselves. |
java.lang.String |
getErrorMessage()
Return the validator error message using the default Locale. |
java.lang.String |
getErrorMessage(java.util.Locale locale)
Get the validator error message for the given locale. |
void |
setFormManager(FormManager formManager)
Set the FormManager. |
void |
setProperties(java.util.Map properties)
Set the global properties which are shared between all validators of a particular type. |
abstract ValidationResult |
validate(FormElement[] formElements,
FormData[] formData,
java.util.Locale locale)
Validate the given FormData array. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected FormManager formManager
protected MessageProvider messageProvider
protected java.util.Map properties
Constructor Detail |
public Validator()
Method Detail |
public final void configure(com.anthonyeden.lib.config.Configuration configuration) throws java.lang.Exception
configuration
- The Configuration object
java.lang.Exception
public void configureInternal(com.anthonyeden.lib.config.Configuration configuration) throws java.lang.Exception
configuration
- The Configuration object
java.lang.Exception
public void setFormManager(FormManager formManager)
formManager
- The FormManagerpublic void setProperties(java.util.Map properties)
properties
- The properties Mappublic java.lang.String getErrorMessage()
public java.lang.String getErrorMessage(java.util.Locale locale)
locale
- The locale
public java.lang.Object clone()
clone
in class java.lang.Object
public abstract ValidationResult validate(FormElement[] formElements, FormData[] formData, java.util.Locale locale) throws java.lang.Exception
formElements
- An array of FormElement objectsformData
- An array of FormData objectslocale
- The Locale
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |