at.gv.egovernment.moa.util
Class MessageProvider
java.lang.Object
|
+--at.gv.egovernment.moa.util.MessageProvider
- public class MessageProvider
- extends Object
A singleton wrapper around a Message
object.
Provides the messages used in the common project.
- Version:
- $Id$
- Author:
- Patrick Peck
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessageProvider
protected MessageProvider(String[] resourceNames,
Locale[] locales)
- Create a
MessageProvider
.
- Parameters:
resourceNames
- The names of the resources containing the messages.locales
- The corresponding locales.
getInstance
public static MessageProvider getInstance()
- Return the single instance of the
MessageProvider
.
Intialilizes the MessageProvider
with the default message
locations: /resources/properties/common_messages
.
- Returns:
- The single
MessageProvider
.
getMessage
public String getMessage(String messageId,
Object[] parameters)
- Get the message corresponding to a given message ID.
- Parameters:
messageId
- The ID of the message.parameters
- The parameters to fill in into the message arguments.- Returns:
- The formatted message.