|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwicket.Localizer
public class Localizer
A utility class that encapsulates all of the localization related
functionality in a way that it can be accessed by all areas of the framework
in a consistent way. A singleton instance of this class is available via the
Application object.
You may register additional IStringResourceLoader to extend or replace Wickets default search strategy for the properties. E.g. string resource loaders which load the properties from a database. There should be no need to extend Localizer.
Settings.getLocalizer(),
IStringResourceLoader,
Settings.getStringResourceLoaders()| Constructor Summary | |
|---|---|
Localizer(Application application)
Create the utils instance class backed by the configuration information contained within the supplied application object. |
|
| Method Summary | |
|---|---|
java.lang.String |
getString(java.lang.String key,
Component component)
|
java.lang.String |
getString(java.lang.String key,
Component component,
IModel model)
|
java.lang.String |
getString(java.lang.String key,
Component component,
IModel model,
java.util.Locale locale,
java.lang.String style,
java.lang.String defaultValue)
Get the localized string using all of the supplied parameters. |
java.lang.String |
getString(java.lang.String key,
Component component,
IModel model,
java.lang.String defaultValue)
|
java.lang.String |
getString(java.lang.String key,
Component component,
java.lang.String defaultValue)
|
java.lang.String |
getString(java.lang.String key,
java.lang.String path,
java.util.List searchStack,
java.util.Locale locale,
java.lang.String style)
Note: This implementation does NOT perform variable substitution |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Localizer(Application application)
application - The application to localize for| Method Detail |
|---|
public java.lang.String getString(java.lang.String key,
Component component)
throws java.util.MissingResourceException
key - The key to obtain the resource forcomponent - The component to get the resource for
java.util.MissingResourceException - If resource not found and configuration dictates that
exception should be throwngetString(String, Component, IModel, Locale, String, String)
public java.lang.String getString(java.lang.String key,
Component component,
IModel model)
throws java.util.MissingResourceException
key - The key to obtain the resource forcomponent - The component to get the resource formodel - The model to use for property substitutions in the strings
(optional)
java.util.MissingResourceException - If resource not found and configuration dictates that
exception should be throwngetString(String, Component, IModel, Locale, String, String)
public java.lang.String getString(java.lang.String key,
Component component,
IModel model,
java.lang.String defaultValue)
throws java.util.MissingResourceException
key - The key to obtain the resource forcomponent - The component to get the resource formodel - The model to use for property substitutions in the strings
(optional)defaultValue - The default value (optional)
java.util.MissingResourceException - If resource not found and configuration dictates that
exception should be throwngetString(String, Component, IModel, Locale, String, String)
public java.lang.String getString(java.lang.String key,
Component component,
java.lang.String defaultValue)
throws java.util.MissingResourceException
key - The key to obtain the resource forcomponent - The component to get the resource fordefaultValue - The default value (optional)
java.util.MissingResourceException - If resource not found and configuration dictates that
exception should be throwngetString(String, Component, IModel, Locale, String, String)
public java.lang.String getString(java.lang.String key,
Component component,
IModel model,
java.util.Locale locale,
java.lang.String style,
java.lang.String defaultValue)
throws java.util.MissingResourceException
key - The key to obtain the resource forcomponent - The component to get the resource for (optional)model - The model to use for substitutions in the strings (optional)locale - The locale to get the resource for (optional)style - The style to get the resource for (optional) (see
Session)defaultValue - The default value (optional)
java.util.MissingResourceException - If resource not found and configuration dictates that
exception should be thrown
public java.lang.String getString(java.lang.String key,
java.lang.String path,
java.util.List searchStack,
java.util.Locale locale,
java.lang.String style)
throws java.util.MissingResourceException
key - The key to obtain the resource forsearchStack - A stack of classes to get the resource forpath - The component id path relative to the pagelocale - The locale to get the resource for (optional)style - The style to get the resource for (optional) (see
Session)
java.util.MissingResourceException - If resource not found and configuration dictates that
exception should be thrown
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||