wicket.resource.loader
Class ClassStringResourceLoader

java.lang.Object
  extended by wicket.resource.loader.AbstractStringResourceLoader
      extended by 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

Field Summary
 
Fields inherited from class wicket.resource.loader.AbstractStringResourceLoader
application
 
Constructor Summary
ClassStringResourceLoader(Application application, java.lang.Class clazz)
          Create and initialise the resource loader.
 
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 wicket.resource.loader.AbstractStringResourceLoader
getProperties, isStopResourceSearch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassStringResourceLoader

public ClassStringResourceLoader(Application application,
                                 java.lang.Class clazz)
Create and initialise the resource loader.

Parameters:
application - Wickets application object
clazz - The class that this resource loader is associated with
Method Detail

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 loaded
key - The key to obtain the string for
locale - The locale identifying the resource set to select the strings from
style - 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.