Package org.apache.commons.validator
Class Var
java.lang.Object
org.apache.commons.validator.Var
- All Implemented Interfaces:
Serializable,Cloneable
A variable that can be associated with a
Field for
passing in information to a pluggable validator. Instances of this class are
configured with a <var> xml element.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a copy of this object.Returns the resource bundle name.Gets the JavaScript type of the variable.getName()Gets the name of the variable.getValue()Gets the value of the variable.booleanTests whether or not the value is a resource key or literal value.voidSets the resource bundle name.voidSets the JavaScript type of the variable.voidSets the name of the variable.voidsetResource(boolean resource) Sets whether or not the value is a resource.voidSets the value of the variable.toString()Returns a string representation of the object.
-
Field Details
-
JSTYPE_INT
Int Constant for JavaScript type. This can be used when auto-generating JavaScript.- See Also:
-
JSTYPE_STRING
String Constant for JavaScript type. This can be used when auto-generating JavaScript.- See Also:
-
JSTYPE_REGEXP
Regular Expression Constant for JavaScript type. This can be used when auto-generating JavaScript.- See Also:
-
-
Constructor Details
-
Var
public Var()Default Constructor. -
Var
Constructs a variable with a specified name, value and JavaScript type.- Parameters:
name- Variable name.value- Variable value.jsType- Variable JavaScript type.
-
-
Method Details
-
clone
Creates and returns a copy of this object. -
getBundle
Returns the resource bundle name.- Returns:
- The bundle name.
- Since:
- 1.2.0
-
getJsType
Gets the JavaScript type of the variable.- Returns:
- The JavaScript type of the variable.
-
getName
Gets the name of the variable.- Returns:
- The name of the variable.
-
getValue
Gets the value of the variable.- Returns:
- The value of the variable.
-
isResource
Tests whether or not the value is a resource key or literal value.- Returns:
trueif value is a resource key.- Since:
- 1.2.0
-
setBundle
Sets the resource bundle name.- Parameters:
bundle- The new bundle name.- Since:
- 1.2.0
-
setJsType
Sets the JavaScript type of the variable.- Parameters:
jsType- The JavaScript type of the variable.
-
setName
Sets the name of the variable.- Parameters:
name- The name of the variable.
-
setResource
Sets whether or not the value is a resource.- Parameters:
resource- If true indicates the value is a resource.- Since:
- 1.2.0
-
setValue
Sets the value of the variable.- Parameters:
value- The value of the variable.
-
toString
Returns a string representation of the object.
-