org.apache.hivemind.impl
Class ModuleMessages

java.lang.Object
  extended by org.apache.hivemind.impl.AbstractMessages
      extended by org.apache.hivemind.impl.ModuleMessages
All Implemented Interfaces:
Messages

public class ModuleMessages
extends AbstractMessages

An implementation of Messages that obtains messages from a MessageFinder, in a locale provided by the ThreadLocale service.

Since:
1.1
Author:
Howard M. Lewis Ship

Constructor Summary
ModuleMessages(MessageFinder messageFinder, ThreadLocale threadLocale)
           
 
Method Summary
protected  java.lang.String findMessage(java.lang.String key)
          Concrete implementations must implement this method.
protected  java.util.Locale getLocale()
          Concrete implementations must provide a non-null Locale.
 
Methods inherited from class org.apache.hivemind.impl.AbstractMessages
containsMessage, format, format, format, format, getMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleMessages

public ModuleMessages(MessageFinder messageFinder,
                      ThreadLocale threadLocale)
Method Detail

getLocale

protected java.util.Locale getLocale()
Description copied from class: AbstractMessages
Concrete implementations must provide a non-null Locale.

Specified by:
getLocale in class AbstractMessages

findMessage

protected java.lang.String findMessage(java.lang.String key)
Description copied from class: AbstractMessages
Concrete implementations must implement this method.

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 AbstractMessages.containsMessage(String)). Prior to 1.2, some implementations would log an error in that situation.

Specified by:
findMessage in class AbstractMessages
Returns:
the localized message for the key, or null if no such message exists.


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