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.- Version:
- $Revision: 1713331 $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe bundle for a variable (when resource = 'true').private StringThe optional JavaScript type of the variable.static final StringInt Constant for JavaScript type.static final StringRegular Expression Constant for JavaScript type.static final StringString Constant for JavaScript type.private StringThe name of the variable.private booleanWhether the variable is a resource [false]private static final longprivate StringThe key or value the variable. -
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
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
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:
-
name
The name of the variable. -
value
The key or value the variable. -
jsType
The optional JavaScript type of the variable. -
resource
private boolean resourceWhether the variable is a resource [false] -
bundle
The bundle for a variable (when resource = 'true').
-
-
Constructor Details
-
Var
public Var()Default Constructor. -
Var
-
-
Method Details
-
getName
-
setName
Sets the name of the variable.- Parameters:
name- The name of the variable.
-
getValue
-
setValue
Sets the value of the variable.- Parameters:
value- The value of the variable.
-
isResource
public boolean isResource()Tests whether or not the value is a resource key or literal value.- Returns:
trueif value is a resource key.- Since:
- Validator 1.2.0
-
setResource
public void setResource(boolean resource) Sets whether or not the value is a resource.- Parameters:
resource- If true indicates the value is a resource.- Since:
- Validator 1.2.0
-
getBundle
Returns the resource bundle name.- Returns:
- The bundle name.
- Since:
- Validator 1.2.0
-
setBundle
Sets the resource bundle name.- Parameters:
bundle- The new bundle name.- Since:
- Validator 1.2.0
-
getJsType
Gets the JavaScript type of the variable.- Returns:
- The Javascript type of the variable.
-
setJsType
Sets the JavaScript type of the variable.- Parameters:
jsType- The Javascript type of the variable.
-
clone
-
toString
-