Package at.gv.egovernment.moaspss.util
Class MessageProvider
java.lang.Object
at.gv.egovernment.moaspss.util.MessageProvider
A singleton wrapper around a
Message object.
Provides the messages used in the common project.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMessageProvider(String[] resourceNames, Locale[] locales) Create aMessageProvider. -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageProviderReturn the single instance of theMessageProvider.getMessage(String messageId, Object[] parameters) Get the message corresponding to a given message ID.
-
Constructor Details
-
MessageProvider
Create aMessageProvider.- Parameters:
resourceNames- The names of the resources containing the messages.locales- The corresponding locales.
-
-
Method Details
-
getInstance
Return the single instance of theMessageProvider. Intialilizes theMessageProviderwith the default message locations:/resources/properties/common_messages.- Returns:
- The single
MessageProvider.
-
getMessage
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.
-