Class Msg

java.lang.Object
org.apache.commons.validator.Msg
All Implemented Interfaces:
Serializable, Cloneable

public class Msg extends Object implements Cloneable, Serializable
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 Link icon

    Fields
    Modifier and Type
    Field
    Description
    protected String
    The resource bundle name that this Msg's key 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).
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    Msg()
    Constructs a new instance.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    Creates and returns a copy of this object.
    Returns the resource bundle name.
    Gets the key/value.
    Gets the name of the dependency.
    boolean
    Tests whether or not the key is a resource key or literal value.
    void
    setBundle(String bundle)
    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.
    Returns a string representation of the object.

    Methods inherited from class java.lang.Object Link icon

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details Link icon

    • bundle Link icon

      protected String bundle
      The resource bundle name that this Msg's key should be resolved in (optional).
      Since:
      1.1
    • key Link icon

      protected String key
      The key or value of the argument.
    • name Link icon

      protected String name
      The name dependency that this argument goes with (optional).
    • resource Link icon

      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:
      1.1.4
  • Constructor Details Link icon

    • Msg Link icon

      public Msg()
      Constructs a new instance.
  • Method Details Link icon

    • clone Link icon

      public Object clone()
      Creates and returns a copy of this object.
      Overrides:
      clone in class Object
      Returns:
      A copy of the Msg.
    • getBundle Link icon

      public String getBundle()
      Returns the resource bundle name.
      Returns:
      The bundle name.
      Since:
      1.1
    • getKey Link icon

      public String getKey()
      Gets the key/value.
      Returns:
      The message key/value.
    • getName Link icon

      public String getName()
      Gets the name of the dependency.
      Returns:
      The dependency name.
    • isResource Link icon

      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:
      1.1.4
    • setBundle Link icon

      public void setBundle(String bundle)
      Sets the resource bundle name.
      Parameters:
      bundle - The new bundle name.
      Since:
      1.1
    • setKey Link icon

      public void setKey(String key)
      Sets the key/value.
      Parameters:
      key - The message key/value.
    • setName Link icon

      public void setName(String name)
      Sets the name of the dependency.
      Parameters:
      name - The dependency name.
    • setResource Link icon

      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:
      1.1.4
    • toString Link icon

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object
      Returns:
      Msg String representation.