com.bankframe.localization
Class LocalizedMessageFormat

java.lang.Object
  extended by com.bankframe.localization.LocalizedMessageFormat

public class LocalizedMessageFormat
extends Object

Adds a layer on top of the java.text.MessageFormat class that localizes individual arguments within the message.


Constructor Summary
LocalizedMessageFormat()
           
 
Method Summary
static String format(String pattern, Object[] arguments)
          This method implements the same behavior as {link java.text.MessageFormat.#format(String, Object[]) MessageFormat.format()} but adds support for one additional qualifer: l8n.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalizedMessageFormat

public LocalizedMessageFormat()
Method Detail

format

public static String format(String pattern,
                            Object[] arguments)
This method implements the same behavior as {link java.text.MessageFormat.#format(String, Object[]) MessageFormat.format()} but adds support for one additional qualifer: l8n. When this qualifier is specified as part of a pattern argument, the corresponding argument will be localized by searching the messages file for a key of the same value as the specified argument. For example if the following pattern is supplied:
Unable to find {0,l8n}
where argument zero is: RETAIL_ACCOUNT this method will attempt to localize argument zero by looking in the messages file for a key named RETAIL_ACCOUNT and substitute the corresponding localized value into the pattern, giving a result that should look like this:
Unable to find Retail Account



Copyright © 2005, 2007, Oracle. All rights reserved.