public class MessageConveyor extends java.lang.Object implements IMessageConveyor
IMessageConveyor
based on resource
bundles.
See also getMessage(Enum, Object...)
for details.
Constructor and Description |
---|
MessageConveyor(java.util.Locale locale)
The
Locale associated with this instance. |
Modifier and Type | Method and Description |
---|---|
<E extends java.lang.Enum<?>> |
getMessage(E key,
java.lang.Object... args)
Given an enum as key, find the corresponding resource bundle and return
the corresponding internationalized.
|
java.lang.String |
getMessage(MessageParameterObj mpo)
Syntactic sugar for the case where the massage is contained in a
MessageParameterObj . |
public MessageConveyor(java.util.Locale locale)
Locale
associated with this instance.locale
- public <E extends java.lang.Enum<?>> java.lang.String getMessage(E key, java.lang.Object... args) throws MessageConveyorException
The name of the resource bundle is defined via the BaseName
annotation whereas the locale is specified in this MessageConveyor
instance's constructor.
getMessage
in interface IMessageConveyor
E
- an enum typekey
- an enum instance used as message keyargs
- optional argumentsMessageConveyorException
public java.lang.String getMessage(MessageParameterObj mpo) throws MessageConveyorException
IMessageConveyor
MessageParameterObj
.
Equivalent to calling
getMessage(mpo.getKey(), mpo.getArgs());
getMessage
in interface IMessageConveyor
mpo
- The MessageParameterObj to translateMessageConveyorException
IMessageConveyor.getMessage(Enum, Object...)