Package org.apache.commons.validator
Class Msg
java.lang.Object
org.apache.commons.validator.Msg
- All Implemented Interfaces:
Serializable
,Cloneable
An alternative message can be associated with a
Field
and a pluggable validator instead of using the default message
stored in the ValidatorAction
(aka pluggable validator).
Instances of this class are configured with a <msg> xml element.- Version:
- $Revision: 1713331 $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
The resource bundle name that this Msg'skey
should be resolved in (optional).protected String
The key or value of the argument.protected String
The name dependency that this argument goes with (optional).protected boolean
Whether or not the key is a message resource (optional).private static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates and returns a copy of this object.Returns the resource bundle name.getKey()
Gets the key/value.getName()
Gets the name of the dependency.boolean
Tests whether or not the key is a resource key or literal value.void
Sets the resource bundle name.void
Sets the key/value.void
Sets the name of the dependency.void
setResource
(boolean resource) Sets whether or not the key is a resource.toString()
Returns a string representation of the object.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
bundle
The resource bundle name that this Msg'skey
should be resolved in (optional).- Since:
- Validator 1.1
-
key
The key or value of the argument. -
name
The name dependency that this argument goes with (optional). -
resource
protected boolean resourceWhether 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
-
-
Constructor Details
-
Msg
public Msg()
-
-
Method Details
-
getBundle
Returns the resource bundle name.- Returns:
- The bundle name.
- Since:
- Validator 1.1
-
setBundle
Sets the resource bundle name.- Parameters:
bundle
- The new bundle name.- Since:
- Validator 1.1
-
getName
Gets the name of the dependency.- Returns:
- The dependency name.
-
setName
Sets the name of the dependency.- Parameters:
name
- The dependency name.
-
getKey
Gets the key/value.- Returns:
- The message key/value.
-
setKey
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:
true
if 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
Creates and returns a copy of this object. -
toString
Returns a string representation of the object.
-