org.apache.commons.resources.impl
Class BasicMessage

java.lang.Object
  extended by org.apache.commons.resources.impl.BasicMessage
All Implemented Interfaces:
Serializable, Message
Direct Known Subclasses:
DatabaseBasicMessage

public class BasicMessage
extends Object
implements Serializable, Message

A basic implementation of the Message interface.

Orginally based on org.apache.struts.action.ActionMessage, Revision 49176.

See Also:
Serialized Form

Constructor Summary
BasicMessage()
          Default Constructor.
BasicMessage(String key)
          Construct a message with no replacement values.
BasicMessage(String key, Object value0)
          Construct a message with the specified replacement values.
BasicMessage(String key, Object[] values)
          Construct a message with the specified replacement values.
BasicMessage(String key, Object value0, Object value1)
          Construct a message with the specified replacement values.
BasicMessage(String key, Object value0, Object value1, Object value2)
          Construct a message with the specified replacement values.
BasicMessage(String key, Object value0, Object value1, Object value2, Object value3)
          Construct a message with the specified replacement values.
 
Method Summary
 String getKey()
           
 String getResourcesName()
          Return the logical name of the Resources instance this message is associated with.
 Object[] getValues()
           
 void setKey(String key)
          Set the key for the message.
 void setResourcesName(String resourcesName)
          Set the logical name of the Resources instance this message is associated with.
 void setValues(Object[] values)
           
 String toString()
          Returns a String in the format: resourcesName:key[value0, value1, etc].
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicMessage

public BasicMessage()
Default Constructor.


BasicMessage

public BasicMessage(String key)
Construct a message with no replacement values.

Parameters:
key - Message key for this message

BasicMessage

public BasicMessage(String key,
                    Object value0)
Construct a message with the specified replacement values.

Parameters:
key - Message key for this message
value0 - First replacement value

BasicMessage

public BasicMessage(String key,
                    Object value0,
                    Object value1)
Construct a message with the specified replacement values.

Parameters:
key - Message key for this message
value0 - First replacement value
value1 - Second replacement value

BasicMessage

public BasicMessage(String key,
                    Object value0,
                    Object value1,
                    Object value2)
Construct a message with the specified replacement values.

Parameters:
key - Message key for this message
value0 - First replacement value
value1 - Second replacement value
value2 - Third replacement value

BasicMessage

public BasicMessage(String key,
                    Object value0,
                    Object value1,
                    Object value2,
                    Object value3)
Construct a message with the specified replacement values.

Parameters:
key - Message key for this message
value0 - First replacement value
value1 - Second replacement value
value2 - Third replacement value
value3 - Fourth replacement value

BasicMessage

public BasicMessage(String key,
                    Object[] values)
Construct a message with the specified replacement values.

Parameters:
key - Message key for this message
values - Array of replacement values
Method Detail

getResourcesName

public String getResourcesName()

Return the logical name of the Resources instance this message is associated with.

Specified by:
getResourcesName in interface Message
Returns:
The name of the resources instance.

setResourcesName

public void setResourcesName(String resourcesName)

Set the logical name of the Resources instance this message is associated with.

Parameters:
resourcesName - The name of the resources instance.

getKey

public String getKey()
Specified by:
getKey in interface Message
Returns:
Get the message key for this message.

setKey

public void setKey(String key)
Set the key for the message.

Parameters:
key - The key to set.

getValues

public Object[] getValues()
Specified by:
getValues in interface Message
Returns:
Get the replacement values for this message.

setValues

public void setValues(Object[] values)
Parameters:
values - The replacement values for this message.

toString

public String toString()
Returns a String in the format: resourcesName:key[value0, value1, etc].

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.