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.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe resource bundle name that this Msg'skeyshould be resolved in (optional).protected StringThe key or value of the argument.protected StringThe name dependency that this argument goes with (optional).protected booleanWhether or not the key is a message resource (optional). -
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.booleanTests whether or not the key is a resource key or literal value.voidSets the resource bundle name.voidSets the key/value.voidSets the name of the dependency.voidsetResource(boolean resource) Sets whether or not the key is a resource.toString()Returns a string representation of the object.
-
Field Details
-
bundle
-
key
-
name
-
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:
- 1.1.4
-
-
Constructor Details
-
Msg
public Msg()Constructs a new instance.
-
-
Method Details
-
clone
-
getBundle
-
getKey
-
getName
-
isResource
Tests whether or not the key is a resource key or literal value.- Returns:
trueif key is a resource key.- Since:
- 1.1.4
-
setBundle
-
setKey
-
setName
-
setResource
Sets whether or not the key is a resource.- Parameters:
resource- If true indicates the key is a resource.- Since:
- 1.1.4
-
toString
-