MessageConveyor (Compiler assisted localization library (CAL10N) - Parent 0.7.7 API)
Date: 2013-03-18

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ch.qos.cal10n
Class MessageConveyor

    java.lang.Object
      ch.qos.cal10n.MessageConveyor

All Implemented Interfaces:
  IMessageConveyor

    public class MessageConveyor

extends Object
implements IMessageConveyor

The default implementation for `IMessageConveyor` based on resource bundles.

See also `getMessage(Enum, Object...)` for details.

Author:
  Ceki Gülcü

Constructor Summary
`MessageConveyor(Locale locale)` The `Locale` associated with this instance.

Method Summary
`
`<E extends Enum<?>> String`
` | `getMessage(E key, Object... args)` Given an enum as key, find the corresponding resource bundle and return the corresponding internationalized.
`String` | `getMessage(MessageParameterObj mpo)` Syntactic sugar for the case where the massage is contained in a `MessageParameterObj`.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MessageConveyor

    public MessageConveyor(Locale locale)

  The `Locale` associated with this instance.

  Parameters:
    `locale` -

Method Detail

### getMessage

    public <E extends Enum<?>> String getMessage(E key,
                                                 Object... args)
                      throws MessageConveyorException

  Given an enum as key, find the corresponding resource bundle and return the corresponding internationalized.

  The name of the resource bundle is defined via the `BaseName` annotation whereas the locale is specified in this MessageConveyor instance's constructor.

  Specified by:
    `getMessage` in interface `IMessageConveyor`
  Type Parameters:
    `E` - an enum type
  Parameters:
    `key` - an enum instance used as message key
    `args` - optional arguments
  Returns:
    The translated/localized message
  Throws:
    `MessageConveyorException`

### getMessage

    public String getMessage(MessageParameterObj mpo)
                      throws MessageConveyorException

  Description copied from interface: `IMessageConveyor`
  Syntactic sugar for the case where the massage is contained in a `MessageParameterObj`.

  Equivalent to calling

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

  Specified by:
    `getMessage` in interface `IMessageConveyor`
  Parameters:
    `mpo` - The MessageParameterObj to translate
  Returns:
    translated message
  Throws:
    `MessageConveyorException`
  See Also:
    `IMessageConveyor.getMessage(Enum, Object...)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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