org.apache.tapestry.engine
Class ComponentMessages
java.lang.Object
|
+--org.apache.tapestry.engine.ComponentMessages
- All Implemented Interfaces:
- IMessages
- public class ComponentMessages
- extends Object
- implements IMessages
Implementation of IMessages
. This is basically
a wrapper around an instance of Properties
. This ensures
that the properties are, in fact, read-only (which ensures that
they don't have to be synchronized).
- Since:
- 2.0.4
- Version:
- $Id: ComponentMessages.java,v 1.4 2003/06/04 12:36:19 hlship Exp $
- Author:
- Howard Lewis Ship
Method Summary |
String |
format(String key,
Object argument)
Convienience method for invoking format(String, Object[]) . |
String |
format(String key,
Object[] arguments)
Formats a string, using
MessageFormat.format(java.lang.String, java.lang.Object[]) . |
String |
format(String key,
Object argument1,
Object argument2)
Convienience method for invoking format(String, Object[]) . |
String |
format(String key,
Object argument1,
Object argument2,
Object argument3)
Convienience method for invoking format(String, Object[]) . |
String |
getMessage(String key)
Searches for a localized string with the given key. |
String |
getMessage(String key,
String defaultValue)
Searches for a localized string with the given key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ComponentMessages
public ComponentMessages(Locale locale,
Properties properties)
getMessage
public String getMessage(String key,
String defaultValue)
- Description copied from interface:
IMessages
- Searches for a localized string with the given key.
If not found, then the default value (which should already
be localized) is returned. Passing a default of null
is useful when trying to determine if the strings contains
a given key.
- Specified by:
getMessage
in interface IMessages
getMessage
public String getMessage(String key)
- Description copied from interface:
IMessages
- Searches for a localized string with the given key.
If not found, a modified version of the key
is returned (all upper-case and surrounded by square
brackets).
- Specified by:
getMessage
in interface IMessages
format
public String format(String key,
Object argument1,
Object argument2,
Object argument3)
- Description copied from interface:
IMessages
- Convienience method for invoking
IMessages.format(String, Object[])
.
- Specified by:
format
in interface IMessages
format
public String format(String key,
Object argument1,
Object argument2)
- Description copied from interface:
IMessages
- Convienience method for invoking
IMessages.format(String, Object[])
.
- Specified by:
format
in interface IMessages
format
public String format(String key,
Object argument)
- Description copied from interface:
IMessages
- Convienience method for invoking
IMessages.format(String, Object[])
.
- Specified by:
format
in interface IMessages
format
public String format(String key,
Object[] arguments)
- Description copied from interface:
IMessages
- Formats a string, using
MessageFormat.format(java.lang.String, java.lang.Object[])
.
- Specified by:
format
in interface IMessages
- Following copied from interface:
org.apache.tapestry.IMessages
- Parameters:
key
- the key used to obtain a localized pattern using
IMessages.getMessage(String)
arguments
- passed to the formatter