wicket.resource
Class ClassStringResourceLoader
java.lang.Object
wicket.resource.ClassStringResourceLoader
- All Implemented Interfaces:
- IStringResourceLoader
- Direct Known Subclasses:
- ApplicationStringResourceLoader
- public class ClassStringResourceLoader
- extends java.lang.Object
- implements IStringResourceLoader
This string resource loader attempts to find a single resource bundle that
has the same name and location as the application. If this bundle is found
then strings are obtained from here. This implemnentation is fully aware of
both locale and style values when trying to obtain the appropriate bundle.
- Author:
- Chris Turner
|
Method Summary |
java.lang.String |
loadStringResource(Component component,
java.lang.String key,
java.util.Locale locale,
java.lang.String style)
Get the string resource for the given combination of key, locale and
style. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassStringResourceLoader
public ClassStringResourceLoader(Application application,
java.lang.Class clazz)
- Create and initialise the resource loader.
- Parameters:
application - Wickets application objectclazz - The class that this resource loader is associated with
loadStringResource
public final java.lang.String loadStringResource(Component component,
java.lang.String key,
java.util.Locale locale,
java.lang.String style)
- Get the string resource for the given combination of key, locale and
style. The information is obtained from a single application-wide
resource bundle.
- Specified by:
loadStringResource in interface IStringResourceLoader
- Parameters:
component - Not used - can be nullkey - The key to obtain the string forlocale - The locale identifying the resource set to select the strings
fromstyle - The (optional) style identifying the resource set to select
the strings from (see Session)
- Returns:
- The string resource value or null if resource not loaded
Copyright © 2004-2006 Wicket developers. All Rights Reserved.