com.bankframe.localization
Class LocalizedMessageFormat

java.lang.Object
  extended bycom.bankframe.localization.LocalizedMessageFormat

public class LocalizedMessageFormat
extends java.lang.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 java.lang.String format(java.lang.String pattern, java.lang.Object[] arguments)
          This method implements the same behavior as 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 java.lang.String format(java.lang.String pattern,
                                      java.lang.Object[] arguments)
This method implements the same behavior as 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.