net.sf.mmm.util.nls.base
Class NlsTemplateImpl
java.lang.Object
net.sf.mmm.util.component.base.AbstractLoggableObject
net.sf.mmm.util.nls.base.AbstractNlsTemplate
net.sf.mmm.util.nls.base.NlsTemplateImpl
- All Implemented Interfaces:
- NlsTemplate
public class NlsTemplateImpl
- extends AbstractNlsTemplate
This class is the implementation of the
NlsTemplate interface. It uses
ResourceBundles for localization.
- Since:
- 2.0.0 (moved, 1.0.0)
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
name
private final String name
- See Also:
getName()
key
private final String key
- See Also:
getKey()
NlsTemplateImpl
public NlsTemplateImpl(String name,
String key)
- The constructor.
- Parameters:
name - is the name of the bundle.key - is the key of the string to lookup in the
bundle.
getName
public String getName()
- This method gets the
base-name used to lookup the bundle (typically a
ResourceBundle).
- Returns:
- the bundleName is the base-name of the associated bundle.
getKey
public String getKey()
- This method gets the
key
of the string to lookup from the bundle. The key is a
technical UID like (ERR_VALUE_OUT_OF_RANGE).
- Returns:
- the bundleKey is the key used to lookup the string from the bundle.
translate
public String translate(Locale locale)
- This method translates the represented string for the given
locale.
This typically happens via a lookup in a ResourceBundle).
- Parameters:
locale - is the locale to translate to.
- Returns:
- the resolved string (closest translation for the given
locale).
toString
public String toString()
-
- Overrides:
toString in class Object
Copyright © 2001-2010 mmm-Team. All Rights Reserved.