|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.validator.ValidatorAction
Contains the information to dynamically create and run a validation method. This is the class representation of a pluggable validator that can be defined in an xml file with the <validator> element. Note: The validation method is assumed to be thread safe.
Constructor Summary | |
ValidatorAction()
|
Method Summary | |
java.lang.String |
getClassname()
Gets the class of the validator action. |
java.lang.Object |
getClassnameInstance()
Deprecated. This will be removed after Validator 1.1.2 |
java.util.Collection |
getDependencies()
Deprecated. Use getDependencyList() instead. |
java.util.List |
getDependencyList()
Returns the dependent validator names as an unmodifiable List . |
java.lang.String |
getDepends()
Gets the dependencies of the validator action as a comma separated list of validator names. |
java.lang.String |
getJavascript()
Gets the Javascript equivalent of the java class and method associated with this action. |
java.lang.String |
getJsFunctionName()
Gets the Javascript function name. |
java.lang.String |
getMethod()
Gets the name of method being called for the validator action. |
java.lang.String |
getMethodParams()
Gets the method parameters for the method. |
java.util.List |
getMethodParamsList()
Deprecated. This will be removed after Validator 1.1.2 |
java.lang.String |
getMsg()
Gets the message associated with the validator action. |
java.lang.String |
getName()
Gets the name of the validator action. |
protected void |
init()
Initialize based on set. |
boolean |
isDependency(java.lang.String validatorName)
Checks whether or not the value passed in is in the depends field. |
protected void |
loadJavascriptFunction()
Load the javascript function specified by the given path. |
void |
process(java.util.Map globalConstants)
Deprecated. This functionality has been moved to other methods. It's no longer required to call this method to initialize this object. |
void |
setClassname(java.lang.String classname)
Sets the class of the validator action. |
void |
setClassnameInstance(java.lang.Object instance)
Deprecated. This will be removed after Validator 1.1.2 |
void |
setDepends(java.lang.String depends)
Sets the dependencies of the validator action. |
void |
setJavascript(java.lang.String javascript)
Sets the Javascript equivalent of the java class and method associated with this action. |
void |
setJsFunction(java.lang.String jsFunction)
Sets the fully qualified class path of the Javascript function. |
void |
setJsFunctionName(java.lang.String jsFunctionName)
Sets the Javascript function name. |
void |
setMethod(java.lang.String method)
Sets the name of method being called for the validator action. |
void |
setMethodParams(java.lang.String methodParams)
Sets the method parameters for the method. |
void |
setMsg(java.lang.String msg)
Sets the message associated with the validator action. |
void |
setName(java.lang.String name)
Sets the name of the validator action. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ValidatorAction()
Method Detail |
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getClassname()
public void setClassname(java.lang.String classname)
public java.lang.String getMethod()
public void setMethod(java.lang.String method)
public java.lang.String getMethodParams()
public void setMethodParams(java.lang.String methodParams)
methodParams
- A comma separated list of parameters.public java.util.List getMethodParamsList()
public java.lang.String getDepends()
public void setDepends(java.lang.String depends)
depends
- A comma separated list of validator names.public java.lang.String getMsg()
public void setMsg(java.lang.String msg)
public java.lang.String getJsFunctionName()
public void setJsFunctionName(java.lang.String jsFunctionName)
public void setJsFunction(java.lang.String jsFunction)
This is optional and can be used instead of the setJavascript().
Attempting to call both setJsFunction
and setJavascript
will result in an IllegalStateException
being thrown.
If neither setJsFunction or setJavascript is set then validator will attempt to load the default javascript definition.
Examples If in the validator.xml : #1: <validator name="tire" jsFunction="com.yourcompany.project.tireFuncion"> Validator will attempt to load com.yourcompany.project.validateTireFunction.js from its class path. #2: <validator name="tire"> Validator will use the name attribute to try and load org.apache.commons.validator.javascript.validateTire.js which is the default javascript definition.
public java.lang.String getJavascript()
public void setJavascript(java.lang.String javascript)
public java.lang.Object getClassnameInstance()
public void setClassnameInstance(java.lang.Object instance)
protected void init()
protected void loadJavascriptFunction()
jsFunction
property should contain a
fully qualified package and script name, separated by periods, to be
loaded from the class loader that created this instance.
TODO if the path begins with a '/' the path will be intepreted as
absolute, and remain unchanged. If this fails then it will attempt to
treat the path as a file path. It is assumed the script ends with a
'.js'.
public void process(java.util.Map globalConstants)
FastHashMap
for the isDependency method
based on depends.
public boolean isDependency(java.lang.String validatorName)
public java.util.Collection getDependencies()
Collection
.
public java.util.List getDependencyList()
List
.
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |