com.gentics.cr.portlet.language
Class LanguageResourceBundle

java.lang.Object
  extended by com.gentics.cr.portlet.language.LanguageResourceBundle

public class LanguageResourceBundle
extends Object

 

Nested Class Summary
protected static class LanguageResourceBundle.UTF8Control
           
 
Field Summary
private static String baseName
          ResourceBundle base name
protected static String BUNDLE_EXTENSION
           
private  Map<Locale,ResourceBundle> resourceBundles
          Map of resource bundles by locale
protected static ResourceBundle.Control UTF8_CONTROL
           
 
Constructor Summary
LanguageResourceBundle(String resourcePath)
          Constructor; takes a baseName of the message properties files.
 
Method Summary
 ResourceBundle getBundle(Locale locale)
          Lookup a bundle for the locale.
 String getMessage(String key, Locale locale)
           
 String getMessage(String key, Object[] args, Locale locale)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUNDLE_EXTENSION

protected static final String BUNDLE_EXTENSION
See Also:
Constant Field Values

UTF8_CONTROL

protected static ResourceBundle.Control UTF8_CONTROL

resourceBundles

private transient Map<Locale,ResourceBundle> resourceBundles
Map of resource bundles by locale


baseName

private static final String baseName
ResourceBundle base name

See Also:
Constant Field Values
Constructor Detail

LanguageResourceBundle

public LanguageResourceBundle(String resourcePath)
Constructor; takes a baseName of the message properties files.

Parameters:
baseName - base name of message properties, e.g. messages/Resources
Method Detail

getMessage

public String getMessage(String key,
                         Locale locale)

getMessage

public String getMessage(String key,
                         Object[] args,
                         Locale locale)

getBundle

public ResourceBundle getBundle(Locale locale)
Lookup a bundle for the locale. If a resource bundle has been loaded already, the "cached" instance is returned; otherwise the bundle is loaded.

Parameters:
locale - requested locale
Returns:
A resource bundle for the locale


Copyright © 2014 Gentics Software GmbH. All Rights Reserved.