org.apache.commons.validator
Class Var
java.lang.Object
org.apache.commons.validator.Var
- Cloneable, Serializable
public class Var
extends java.lang.Object
implements Cloneable, Serializable
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.
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.
|
private String | bundle - The bundle for a variable (when resource = 'true').
|
private String | jsType - The optional JavaScript type of the variable.
|
private String | name - The name of the variable.
|
private boolean | resource - Whether the variable is a resource [false]
|
private String | value - The key or value the variable.
|
Var() - Default Constructor.
|
Var(String name, String value, String jsType) - Constructs a variable with a specified name, value
and Javascript type.
|
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.
|
JSTYPE_INT
public static final String JSTYPE_INT
Int Constant for JavaScript type. This can be used
when auto-generating JavaScript.
JSTYPE_REGEXP
public static final String JSTYPE_REGEXP
Regular Expression Constant for JavaScript type. This can be used
when auto-generating JavaScript.
JSTYPE_STRING
public static final String JSTYPE_STRING
String Constant for JavaScript type. This can be used
when auto-generating JavaScript.
bundle
private String bundle
The bundle for a variable (when resource = 'true').
jsType
private String jsType
The optional JavaScript type of the variable.
name
private String name
The name of the variable.
resource
private boolean resource
Whether the variable is a resource [false]
value
private String value
The key or value the variable.
Var
public Var()
Default Constructor.
Var
public Var(String name,
String value,
String jsType)
Constructs a variable with a specified name, value
and Javascript type.
name
- Variable name.value
- Variable value.jsType
- Variable Javascript type.
clone
public Object clone()
Creates and returns a copy of this object.
getBundle
public String getBundle()
Returns the resource bundle name.
getJsType
public String getJsType()
Gets the JavaScript type of the variable.
- The Javascript type of the variable.
getName
public String getName()
Gets the name of the variable.
- The name of the variable.
getValue
public String getValue()
Gets the value of the variable.
- The value of the variable.
isResource
public boolean isResource()
Tests whether or not the value is a resource key or literal value.
true
if value is a resource key.
setBundle
public void setBundle(String bundle)
Sets the resource bundle name.
bundle
- The new bundle name.
setJsType
public void setJsType(String jsType)
Sets the JavaScript type of the variable.
jsType
- The Javascript type of the variable.
setName
public void setName(String name)
Sets the name of the variable.
name
- The name of the variable.
setResource
public void setResource(boolean resource)
Sets whether or not the value is a resource.
resource
- If true indicates the value is a resource.
setValue
public void setValue(String value)
Sets the value of the variable.
value
- The value of the variable.
toString
public String toString()
Returns a string representation of the object.
- A string representation of the variable.
Copyright (c) 2001-2004 Apache Software Foundation