Class MessageProvider

java.lang.Object
at.gv.egovernment.moaspss.util.MessageProvider

public class MessageProvider extends Object
A singleton wrapper around a Message object. Provides the messages used in the common project.
  • Constructor Details

    • MessageProvider

      protected MessageProvider(String[] resourceNames, Locale[] locales)
      Create a MessageProvider.
      Parameters:
      resourceNames - The names of the resources containing the messages.
      locales - The corresponding locales.
  • Method Details

    • 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.