Package ch.qos.cal10n
Class MessageConveyor
java.lang.Object
ch.qos.cal10n.MessageConveyor
- All Implemented Interfaces:
IMessageConveyor
The default implementation for
IMessageConveyor
based on resource
bundles.
See also getMessage(Enum, Object...)
for details.- Author:
- Ceki Gülcü
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSyntactic sugar for the case where the massage is contained in aMessageParameterObj
.getMessage
(E key, Object... args) Given an enum as key, find the resource bundle corresponding to this locale and return the message corresponding to the key passed as parameter (internationalized per this locale).
-
Constructor Details
-
MessageConveyor
TheLocale
associated with this instance.- Parameters:
locale
- the Locale which this conveyor targets
-
-
Method Details
-
getMessage
Given an enum as key, find the resource bundle corresponding to this locale and return the message corresponding to the key passed as parameter (internationalized per this locale). The name of the resource bundle is defined via theBaseName
annotation whereas the locale is specified in this MessageConveyor instance's constructor.- Specified by:
getMessage
in interfaceIMessageConveyor
- Type Parameters:
E
- an enum type- Parameters:
key
- an enum instance used as message keyargs
- optional arguments- Returns:
- The translated/localized message
- Throws:
MessageConveyorException
-
getMessage
Description copied from interface:IMessageConveyor
Syntactic sugar for the case where the massage is contained in aMessageParameterObj
.Equivalent to calling
getMessage(mpo.getKey(), mpo.getArgs());
- Specified by:
getMessage
in interfaceIMessageConveyor
- Parameters:
mpo
- The MessageParameterObj to translate- Returns:
- translated message
- Throws:
MessageConveyorException
- See Also:
-