Package org.apache.commons.validator
Class Msg
- java.lang.Object
-
- org.apache.commons.validator.Msg
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class Msg extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableAn alternative message can be associated with aFieldand a pluggable validator instead of using the default message stored in theValidatorAction(aka pluggable validator). Instances of this class are configured with a <msg> xml element.- Version:
- $Revision: 1713331 $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringbundleThe resource bundle name that this Msg'skeyshould be resolved in (optional).protected java.lang.StringkeyThe key or value of the argument.protected java.lang.StringnameThe name dependency that this argument goes with (optional).protected booleanresourceWhether or not the key is a message resource (optional).private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description Msg()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Creates and returns a copy of this object.java.lang.StringgetBundle()Returns the resource bundle name.java.lang.StringgetKey()Gets the key/value.java.lang.StringgetName()Gets the name of the dependency.booleanisResource()Tests whether or not the key is a resource key or literal value.voidsetBundle(java.lang.String bundle)Sets the resource bundle name.voidsetKey(java.lang.String key)Sets the key/value.voidsetName(java.lang.String name)Sets the name of the dependency.voidsetResource(boolean resource)Sets whether or not the key is a resource.java.lang.StringtoString()Returns a string representation of the object.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
bundle
protected java.lang.String bundle
The resource bundle name that this Msg'skeyshould be resolved in (optional).- Since:
- Validator 1.1
-
key
protected java.lang.String key
The key or value of the argument.
-
name
protected java.lang.String name
The name dependency that this argument goes with (optional).
-
resource
protected boolean resource
Whether or not the key is a message resource (optional). Defaults to true. If it is 'true', the value will try to be resolved as a message resource.- Since:
- Validator 1.1.4
-
-
Method Detail
-
getBundle
public java.lang.String getBundle()
Returns the resource bundle name.- Returns:
- The bundle name.
- Since:
- Validator 1.1
-
setBundle
public void setBundle(java.lang.String bundle)
Sets the resource bundle name.- Parameters:
bundle- The new bundle name.- Since:
- Validator 1.1
-
getName
public java.lang.String getName()
Gets the name of the dependency.- Returns:
- The dependency name.
-
setName
public void setName(java.lang.String name)
Sets the name of the dependency.- Parameters:
name- The dependency name.
-
getKey
public java.lang.String getKey()
Gets the key/value.- Returns:
- The message key/value.
-
setKey
public void setKey(java.lang.String key)
Sets the key/value.- Parameters:
key- The message key/value.
-
isResource
public boolean isResource()
Tests whether or not the key is a resource key or literal value.- Returns:
trueif key is a resource key.- Since:
- Validator 1.1.4
-
setResource
public void setResource(boolean resource)
Sets whether or not the key is a resource.- Parameters:
resource- If true indicates the key is a resource.- Since:
- Validator 1.1.4
-
clone
public java.lang.Object clone()
Creates and returns a copy of this object.- Overrides:
clonein classjava.lang.Object- Returns:
- A copy of the Msg.
-
toString
public java.lang.String toString()
Returns a string representation of the object.- Overrides:
toStringin classjava.lang.Object- Returns:
- Msg String representation.
-
-