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
<E extends Enum<?>>
String
getMessage(E key, Object... args)
          Retrieve a localized message by its key as specified by an enum.
 String getMessage(MessageParameterObj mpo)
          Syntactic sugar for the case where the massage is contained in a MessageParameterObj.
 

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 instance
args - 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 a MessageParameterObj.

Equivalent to calling

 getMessage(mpo.getKey(), mpo.getArgs());
 

Parameters:
mpo - The MessageParameterObj to translate
Returns:
translated message
Throws:
MessageConveyorException
See Also:
getMessage(Enum, Object...)


Copyright © 2009-2013 QOS.ch. All Rights Reserved.