|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.formproc.validation.Validator | +--org.formproc.validation.ScriptValidator
A Validator which uses a BSF-supported script to validate the form data.
Scripts are located by using the scriptRoot
value as the base
search path. The script root can either be a file or the classpath. In
the case of the class path, the script must be located in the class path.
Field Summary | |
static java.lang.String |
DEFAULT_SCRIPT_ROOT_TYPE
The default script root type ("file"). |
static java.lang.String |
SCRIPT_ROOT_TYPE_CLASSPATH
The script root type "classpath". |
static java.lang.String |
SCRIPT_ROOT_TYPE_FILE
The script root type "file". |
Fields inherited from class org.formproc.validation.Validator |
formManager, messageProvider, properties |
Constructor Summary | |
ScriptValidator()
Construct a new ScriptValidator. |
Method Summary | |
void |
configureInternal(com.anthonyeden.lib.config.Configuration configuration)
Configure the validator using the given JDOM element. |
java.io.File |
getScript()
Get the script file. |
java.io.File |
getScriptRoot()
Get the script root. |
java.lang.String |
getScriptRootType()
Get the type for the script root. |
void |
setProperties(java.util.Map properties)
Set the global properties which are shared between all validators of a particular type. |
void |
setScript(java.io.File script)
Set the script file. |
void |
setScript(java.lang.String script)
Set the script file. |
void |
setScriptRoot(java.io.File scriptRoot)
Set the script root. |
void |
setScriptRoot(java.lang.String scriptRoot)
Set the script root. |
void |
setScriptRootType(java.lang.String scriptRootType)
Set the type for the script root. |
ValidationResult |
validate(FormElement[] formElements,
FormData[] formData,
java.util.Locale locale)
Validate the given FormData. |
Methods inherited from class org.formproc.validation.Validator |
clone, configure, getErrorMessage, getErrorMessage, setFormManager |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String SCRIPT_ROOT_TYPE_FILE
public static final java.lang.String SCRIPT_ROOT_TYPE_CLASSPATH
public static final java.lang.String DEFAULT_SCRIPT_ROOT_TYPE
Constructor Detail |
public ScriptValidator()
Method Detail |
public java.io.File getScriptRoot()
public void setScriptRoot(java.io.File scriptRoot)
scriptRoot
- The new script rootpublic void setScriptRoot(java.lang.String scriptRoot)
scriptRoot
- The new script root pathpublic java.lang.String getScriptRootType()
The default type is "file".
public void setScriptRootType(java.lang.String scriptRootType)
scriptRootType
- The script root type, either "file" or "classpath"getScriptRootType()
public java.io.File getScript()
public void setScript(java.io.File script)
script
- The new script filepublic void setScript(java.lang.String script)
script
- The new script filepublic void configureInternal(com.anthonyeden.lib.config.Configuration configuration) throws java.lang.Exception
configureInternal
in class Validator
configuration
- The Configuration object
java.lang.Exception
public void setProperties(java.util.Map properties)
setProperties
in class Validator
properties
- The properties Mappublic ValidationResult validate(FormElement[] formElements, FormData[] formData, java.util.Locale locale) throws java.lang.Exception
validate
in class Validator
formData
- The FormDatalocale
- The LocaleformElements
- An array of FormElement objects
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |