org.apache.commons.validator
public class Arg extends java.lang.Object implements java.lang.Cloneable, java.io.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.
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
bundle
The resource bundle name that this Arg's
key should be
resolved in (optional). |
protected java.lang.String |
key
The key or value of the argument.
|
protected java.lang.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).
|
Constructor and Description |
---|
Arg() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates and returns a copy of this object.
|
java.lang.String |
getBundle()
Returns the resource bundle name.
|
java.lang.String |
getKey()
Gets the key/value.
|
java.lang.String |
getName()
Gets the name of the dependency.
|
int |
getPosition()
Argument's replacement position.
|
boolean |
isResource()
Tests whether or not the key is a resource key or literal value.
|
void |
setBundle(java.lang.String bundle)
Sets the resource bundle name.
|
void |
setKey(java.lang.String key)
Sets the key/value.
|
void |
setName(java.lang.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.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
protected java.lang.String bundle
key
should be
resolved in (optional).protected java.lang.String key
protected java.lang.String name
protected int position
protected boolean resource
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String getBundle()
public java.lang.String getKey()
public java.lang.String getName()
public int getPosition()
public boolean isResource()
true
if key is a resource key.public void setBundle(java.lang.String bundle)
bundle
- The new bundle name.public void setKey(java.lang.String key)
key
- They to access the argument.public void setName(java.lang.String name)
name
- the name of the dependency.public void setPosition(int position)
position
- set this argument's replacement position.public void setResource(boolean resource)
resource
- If true indicates the key is a resource.public java.lang.String toString()
toString
in class java.lang.Object
Copyright (c) 2001-2004 Apache Software Foundation