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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getMessage(MessageParameterObj mpo)
Syntactic sugar for the case where the massage is contained in aMessageParameterObj
.<E extends java.lang.Enum<?>>
java.lang.StringgetMessage(E key, java.lang.Object... args)
Retrieve a localized message by its key as specified by an enum.
-
-
-
Method Detail
-
getMessage
<E extends java.lang.Enum<?>> java.lang.String getMessage(E key, java.lang.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
java.lang.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...)
-
-