de.smartics.exceptions.i18n.message
Class IcuMessageComposer

Package class diagram package IcuMessageComposer
java.lang.Object
  extended by de.smartics.exceptions.i18n.message.IcuMessageComposer
All Implemented Interfaces:
MessageComposer

public final class IcuMessageComposer
     
     
extends Object
implements MessageComposer

Message composer implementation that is bases on MessageFormat of the icu4j project.


Constructor Summary
IcuMessageComposer()
          Default constructor.
 
Method Summary
 String composeMessage(Object bean, Locale locale, ResourceBundle bundle, String keyPrefix, MessageType messageType)
          Creates the message from the message template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IcuMessageComposer

public IcuMessageComposer()
Default constructor.

Method Detail

composeMessage

public String composeMessage(Object bean,
                             Locale locale,
                             ResourceBundle bundle,
                             String keyPrefix,
                             MessageType messageType)
                      throws NullPointerException,
                             IllegalArgumentException
Description copied from interface: MessageComposer
Creates the message from the message template.

Specified by:
composeMessage in interface MessageComposer
Parameters:
bean - the instance with the values for the message template's parameters.
locale - the locale to use to format the arguments within the template.
bundle - the resource bundle to fetch the message from.
keyPrefix - the prefix to the key to fetch the message from the bundle. The suffix is provided by the message type.
messageType - the type of message to format. This allows to access the correct index of the exception's value within the template.
Returns:
the message constructed from the template and the exception's member values.
Throws:
NullPointerException - if messageType is null.
IllegalArgumentException - if messageType is blank.


Copyright © 2007-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.