Package ch.qos.cal10n
Interface IMessageConveyor
-
- All Known Implementing Classes:
MessageConveyor
public interface IMessageConveyor
Retrieve a localized message by its key as specified by an enum.The strategy in retrieving messages may vary from implementation to implementation.
- Author:
- Ceki Gülcü
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getMessage(MessageParameterObj mpo)
Syntactic sugar for the case where the massage is contained in aMessageParameterObj
.<E extends Enum<?>>
StringgetMessage(E key, Object... args)
Retrieve a localized message by its key as specified by an enum.
-
-
-
Method Detail
-
getMessage
<E extends Enum<?>> String getMessage(E key, Object... args) throws MessageConveyorException
Retrieve a localized message by its key as specified by an enum.Note that any further arguments passed in 'args' will be interpolated using the translated message. The interpolation will be done by and according to conventions of
MessageFormat
.- Type Parameters:
E
- an enum type- Parameters:
key
- an enum instanceargs
- optional arguments- Returns:
- The translated/localized message
- Throws:
MessageConveyorException
-
getMessage
String getMessage(MessageParameterObj mpo) throws MessageConveyorException
Syntactic sugar for the case where the massage is contained in aMessageParameterObj
.Equivalent to calling
getMessage(mpo.getKey(), mpo.getArgs());
- Parameters:
mpo
- The MessageParameterObj to translate- Returns:
- translated message
- Throws:
MessageConveyorException
- See Also:
getMessage(Enum, Object...)
-
-