org.apache.abdera.i18n.text
Class Localizer

java.lang.Object
  extended by org.apache.abdera.i18n.text.Localizer

public final class Localizer
extends Object

Wraps ResourceBundle with a couple of additional, useful methods. Used for l10n


Constructor Summary
Localizer()
           
Localizer(Locale locale, ClassLoader loader)
           
Localizer(ResourceBundle bundle)
           
Localizer(ResourceBundle bundle, Locale locale)
           
Localizer(String bundle)
           
Localizer(String bundle, Locale locale)
           
 
Method Summary
static String format(String key, Object... args)
          Deprecated.  
 String formatValue(String key, Object... args)
          Deprecated.  
static String get(String key)
           
static String get(String key, String defaultValue)
           
static Localizer getInstance()
           
 Locale getLocale()
           
 String getValue(String key)
           
 String getValue(String key, String defaultValue)
           
static void setInstance(Localizer localizer)
           
static String sprintf(String key, Object... args)
           
 String sprintfValue(String key, Object... args)
          Use the JDK 1.5 sprintf style Formatter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Localizer

public Localizer()

Localizer

public Localizer(Locale locale,
                 ClassLoader loader)

Localizer

public Localizer(String bundle)

Localizer

public Localizer(String bundle,
                 Locale locale)

Localizer

public Localizer(ResourceBundle bundle)

Localizer

public Localizer(ResourceBundle bundle,
                 Locale locale)
Method Detail

getInstance

public static Localizer getInstance()

setInstance

public static void setInstance(Localizer localizer)

get

public static String get(String key)

get

public static String get(String key,
                         String defaultValue)

format

public static String format(String key,
                            Object... args)
Deprecated. 


sprintf

public static String sprintf(String key,
                             Object... args)

getLocale

public Locale getLocale()

getValue

public String getValue(String key)

getValue

public String getValue(String key,
                       String defaultValue)

formatValue

public String formatValue(String key,
                          Object... args)
Deprecated. 

Use the pre-JDK 1.5 MessageFormat. This should be avoided. Applications should use the sprintfValue method instead

See Also:
springfValue

sprintfValue

public String sprintfValue(String key,
                           Object... args)
Use the JDK 1.5 sprintf style Formatter



Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.