com.antelmann.util
Class Localizable.Adapter
java.lang.Object
com.antelmann.util.Localizable.Adapter
- All Implemented Interfaces:
- Localizable
- Enclosing interface:
- Localizable
public static class Localizable.Adapter
- extends Object
- implements Localizable
|
Method Summary |
Locale |
getLocale()
allows access to the Locale that this instance currently uses to localize its messages, |
static Object |
localize(Localizable t,
Locale l,
Object context,
String method,
Object... params)
|
void |
setLocale(Locale locale,
Object context)
sets the Locale for this object so that all subsequent return values
of method calls to this instance can be localized accordingly until a different
Locale is set. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Localizable.Adapter
public Localizable.Adapter()
localize
public static Object localize(Localizable t,
Locale l,
Object context,
String method,
Object... params)
throws IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
- Throws:
IllegalAccessException
InvocationTargetException
NoSuchMethodException
getLocale
public Locale getLocale()
- Description copied from interface:
Localizable
- allows access to the Locale that this instance currently uses to localize its messages,
- Specified by:
getLocale in interface Localizable
- Returns:
- the current Locale that this instance uses to determine return values
for its methods; if null is returned, this instance is expected to use the default Locale of the system.
- See Also:
Localizable.setLocale(Locale, Object)
setLocale
public void setLocale(Locale locale,
Object context)
- Description copied from interface:
Localizable
- sets the Locale for this object so that all subsequent return values
of method calls to this instance can be localized accordingly until a different
Locale is set.
- Specified by:
setLocale in interface Localizable
- Parameters:
locale - the Locale that is to be used to determine return values for all methods
of this instance; if set to null, the default locale is to be used.context - a context that may be required for this instance to load the resources for the given locale;
this context may be null for objects that do not require an external context.
Examples of a context may be a database, a resource file, some map or no context at all.- See Also:
Localizable.getLocale()
(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads