org.apache.commons.validator
public class Var extends Object implements Cloneable, Serializable
Field for
passing in information to a pluggable validator. Instances of this class are
configured with a <var> xml element.
Version: $Revision: 478334 $ $Date: 2006-11-22 21:31:54 +0000 (Wed, 22 Nov 2006) $
| Field Summary | |
|---|---|
| String | bundle
The bundle for a variable (when resource = 'true'). |
| String | jsType
The optional JavaScript type of the variable. |
| static String | JSTYPE_INT
Int Constant for JavaScript type. |
| static String | JSTYPE_REGEXP
Regular Expression Constant for JavaScript type. |
| static String | JSTYPE_STRING
String Constant for JavaScript type. |
| String | name
The name of the variable. |
| boolean | resource
Whether the variable is a resource [false] |
| String | value
The key or value the variable. |
| Constructor Summary | |
|---|---|
| Var()
Default Constructor. | |
| Var(String name, String value, String jsType)
Constructs a variable with a specified name, value
and Javascript type. | |
| Method Summary | |
|---|---|
| Object | clone()
Creates and returns a copy of this object. |
| String | getBundle()
Returns the resource bundle name. |
| String | getJsType()
Gets the JavaScript type of the variable. |
| String | getName()
Gets the name of the variable. |
| String | getValue()
Gets the value of the variable. |
| boolean | isResource()
Tests whether or not the value is a resource key or literal value. |
| void | setBundle(String bundle)
Sets the resource bundle name. |
| void | setJsType(String jsType)
Sets the JavaScript type of the variable. |
| void | setName(String name)
Sets the name of the variable. |
| void | setResource(boolean resource)
Sets whether or not the value is a resource. |
| void | setValue(String value)
Sets the value of the variable. |
| String | toString()
Returns a string representation of the object. |
Parameters: name Variable name. value Variable value. jsType Variable Javascript type.
Returns: A copy of the variable.
Returns: The bundle name.
Since: Validator 1.2.0
Returns: The Javascript type of the variable.
Returns: The name of the variable.
Returns: The value of the variable.
Returns: true if value is a resource key.
Since: Validator 1.2.0
Parameters: bundle The new bundle name.
Since: Validator 1.2.0
Parameters: jsType The Javascript type of the variable.
Parameters: name The name of the variable.
Parameters: resource If true indicates the value is a resource.
Since: Validator 1.2.0
Parameters: value The value of the variable.
Returns: A string representation of the variable.