wicket.resource.loader
Class ClassStringResourceLoader
java.lang.Object
wicket.resource.loader.AbstractStringResourceLoader
wicket.resource.loader.ClassStringResourceLoader
- All Implemented Interfaces:
- IStringResourceLoader
- Direct Known Subclasses:
- ApplicationStringResourceLoader
public class ClassStringResourceLoader
- extends AbstractStringResourceLoader
This string resource loader attempts to find a single resource bundle that
has the same name and location as the clazz. If this bundle is found
then strings are obtained from here. This implementation is fully aware of
both locale and style values when trying to obtain the appropriate bundle.
- Author:
- Chris Turner, Juergen Donnerstag
|
Method Summary |
java.lang.String |
loadStringResource(java.lang.Class clazz,
java.lang.String key,
java.util.Locale locale,
java.lang.String style)
Get the string resource for the given combination of class, 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 java.lang.String loadStringResource(java.lang.Class clazz,
java.lang.String key,
java.util.Locale locale,
java.lang.String style)
- Description copied from class:
AbstractStringResourceLoader
- Get the string resource for the given combination of class, key, locale
and style. The information is obtained from a resource bundle associated
with the provided Class (or one of its super classes).
- Specified by:
loadStringResource in interface IStringResourceLoader- Overrides:
loadStringResource in class AbstractStringResourceLoader
- Parameters:
clazz - The Class to find resources to be loadedkey - 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 found
Copyright © 2004-2007 Wicket developers. All Rights Reserved.