|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hivemind.impl.AbstractMessages
public abstract class AbstractMessages
Abstract base class for implementations of Messages
. Subclasses must
provide getLocale()
and findMessage(String)
implementations.
Constructor Summary | |
---|---|
AbstractMessages()
|
Method Summary | |
---|---|
boolean |
containsMessage(java.lang.String key)
Returns true if the given key is associated with a message, false otherwise. |
protected abstract java.lang.String |
findMessage(java.lang.String key)
Concrete implementations must implement this method. |
java.lang.String |
format(java.lang.String key,
java.lang.Object arg0)
Convienience method for invoking Messages.format(String, Object[]) . |
java.lang.String |
format(java.lang.String key,
java.lang.Object[] args)
Formats a string, using MessageFormat.format(java.lang.String, java.lang.Object[]) . |
java.lang.String |
format(java.lang.String key,
java.lang.Object arg0,
java.lang.Object arg1)
Convienience method for invoking Messages.format(String, Object[]) . |
java.lang.String |
format(java.lang.String key,
java.lang.Object arg0,
java.lang.Object arg1,
java.lang.Object arg2)
Convienience method for invoking Messages.format(String, Object[]) . |
protected abstract java.util.Locale |
getLocale()
Concrete implementations must provide a non-null Locale. |
java.lang.String |
getMessage(java.lang.String key)
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 |
Constructor Detail |
---|
public AbstractMessages()
Method Detail |
---|
public final java.lang.String format(java.lang.String key, java.lang.Object[] args)
Messages
MessageFormat.format(java.lang.String, java.lang.Object[])
.
format
in interface Messages
key
- the key used to obtain a localized pattern using Messages.getMessage(String)
args
- passed to the formatterpublic final java.lang.String format(java.lang.String key, java.lang.Object arg0)
Messages
Messages.format(String, Object[])
.
format
in interface Messages
public final java.lang.String format(java.lang.String key, java.lang.Object arg0, java.lang.Object arg1)
Messages
Messages.format(String, Object[])
.
format
in interface Messages
public final java.lang.String format(java.lang.String key, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2)
Messages
Messages.format(String, Object[])
.
format
in interface Messages
public final boolean containsMessage(java.lang.String key)
Messages
containsMessage
in interface Messages
public final java.lang.String getMessage(java.lang.String key)
Messages
getMessage
in interface Messages
protected abstract java.util.Locale getLocale()
protected abstract java.lang.String findMessage(java.lang.String key)
Note: starting with release 1.2, it is no longer considered an error if the key does not
match a known message (i.e., due to containsMessage(String)
). Prior to 1.2, some
implementations would log an error in that situation.
key
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |