org.apache.commons.validator

Class Var

public class Var extends 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.
Field Summary
StringjsType
The optional JavaScript type of the variable.
static StringJSTYPE_INT
Int Constant for JavaScript type.
static StringJSTYPE_REGEXP
Regular Expression Constant for JavaScript type.
static StringJSTYPE_STRING
String Constant for JavaScript type.
Stringname
The name of the variable.
Stringvalue
The name of the value.
Constructor Summary
Var()
Var(String name, String value, String jsType)
Method Summary
Objectclone()
Creates and returns a copy of this object.
StringgetJsType()
Gets the JavaScript type of the variable.
StringgetName()
Gets the name of the variable.
StringgetValue()
Gets the value of the variable.
voidsetJsType(String jsType)
Sets the JavaScript type of the variable.
voidsetName(String name)
Sets the name of the variable.
voidsetValue(String value)
Sets the value of the variable.
StringtoString()
Returns a string representation of the object.

Field Detail

jsType

private String jsType
The optional JavaScript type of the variable.

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.

name

private String name
The name of the variable.

value

private String value
The name of the value.

Constructor Detail

Var

public Var()

Var

public Var(String name, String value, String jsType)

Method Detail

clone

public Object clone()
Creates and returns a copy of this object.

getJsType

public String getJsType()
Gets the JavaScript type of the variable.

getName

public String getName()
Gets the name of the variable.

getValue

public String getValue()
Gets the value of the variable.

setJsType

public void setJsType(String jsType)
Sets the JavaScript type of the variable.

setName

public void setName(String name)
Sets the name of the variable.

setValue

public void setValue(String value)
Sets the value of the variable.

toString

public String toString()
Returns a string representation of the object.
Copyright (c) 2001-2004 Apache Software Foundation