org.apache.commons.validator
public class Arg extends Object implements Cloneable, Serializable
A default argument or an argument for a
specific validator definition (ex: required)
can be stored to pass into a message as parameters. This can be used in a
pluggable validator for constructing locale
sensitive messages by using java.text.MessageFormat
or an equivalent class. The resource field can be
used to determine if the value stored in the argument
is a value to be retrieved from a locale sensitive
message retrieval system like java.util.PropertyResourceBundle
.
The resource field defaults to 'true'.
Instances of this class are configured with an <arg> xml element.
Field Summary | |
---|---|
protected String | bundle
The resource bundle name that this Arg's key should be
resolved in (optional). |
protected String | key
The key or value of the argument. |
protected String | name
The name dependency that this argument goes with (optional). |
protected int | position
This argument's position in the message. |
protected boolean | resource
Whether or not the key is a message resource (optional). |
Method Summary | |
---|---|
Object | clone()
Creates and returns a copy of this object. |
String | getBundle()
Returns the resource bundle name. |
String | getKey()
Gets the key/value. |
String | getName()
Gets the name of the dependency. |
int | getPosition()
Argument's replacement position. |
boolean | getResource()
Gets whether or not the key is a resource. |
boolean | isResource()
Tests whether or not the key is a resource key or literal value. |
void | setBundle(String bundle)
Sets the resource bundle name. |
void | setKey(String key)
Sets the key/value. |
void | setName(String name)
Sets the name of the dependency. |
void | setPosition(int position)
Set this argument's replacement position. |
void | setResource(boolean resource)
Sets whether or not the key is a resource. |
String | toString()
Returns a string representation of the object. |
key
should be
resolved in (optional).Since: Validator 1.1
Since: Validator 1.1
Returns: A copy of this object.
Since: Validator 1.1
Returns: the key value.
Returns: the name of the dependency.
Returns: This argument's replacement position.
Deprecated: Use isResource() instead.
Gets whether or not the key is a resource.Returns: Returns true if key is a resource.
Returns: true
if key is a resource key.
Parameters: bundle The new bundle name.
Since: Validator 1.1
Parameters: key They to access the argument.
Parameters: name the name of the dependency.
Parameters: position set this argument's replacement position.
Parameters: resource If true indicates the key is a resource.
Returns: a string representation of the object.