org.apache.hivemind
Interface Messages

All Known Implementing Classes:
AbstractMessages, MessageFormatter, ModuleMessages

public interface Messages

A set of localized message strings. This is somewhat like a ResourceBundle, but with more flexibility about where the messages come from. In addition, it includes methods similar to MessageFormat for treating the messages as patterns.

Author:
Howard Lewis Ship

Method Summary
 boolean containsMessage(java.lang.String key)
          Returns true if the given key is associated with a message, false otherwise.
 java.lang.String format(java.lang.String key, java.lang.Object argument)
          Convienience method for invoking format(String, Object[]).
 java.lang.String format(java.lang.String key, java.lang.Object[] arguments)
          Formats a string, using MessageFormat.format(java.lang.String, java.lang.Object[]).
 java.lang.String format(java.lang.String key, java.lang.Object argument1, java.lang.Object argument2)
          Convienience method for invoking format(String, Object[]).
 java.lang.String format(java.lang.String key, java.lang.Object argument1, java.lang.Object argument2, java.lang.Object argument3)
          Convienience method for invoking format(String, Object[]).
 java.lang.String getMessage(java.lang.String key)
          Searches for a localized string with the given key.
 

Method Detail

containsMessage

boolean containsMessage(java.lang.String key)
Returns true if the given key is associated with a message, false otherwise.

Since:
1.2

getMessage

java.lang.String getMessage(java.lang.String key)
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).


format

java.lang.String format(java.lang.String key,
                        java.lang.Object[] arguments)
Formats a string, using MessageFormat.format(java.lang.String, java.lang.Object[]).

Parameters:
key - the key used to obtain a localized pattern using getMessage(String)
arguments - passed to the formatter

format

java.lang.String format(java.lang.String key,
                        java.lang.Object argument)
Convienience method for invoking format(String, Object[]).


format

java.lang.String format(java.lang.String key,
                        java.lang.Object argument1,
                        java.lang.Object argument2)
Convienience method for invoking format(String, Object[]).


format

java.lang.String format(java.lang.String key,
                        java.lang.Object argument1,
                        java.lang.Object argument2,
                        java.lang.Object argument3)
Convienience method for invoking format(String, Object[]).



Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.