wicket.resource
Class ClassStringResourceLoader

java.lang.Object
  extended bywicket.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

Constructor Summary
ClassStringResourceLoader(Application application, java.lang.Class clazz)
          Create and initialise the resource loader.
 
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
 

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 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 null
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 loaded


Copyright © 2004-2006 Wicket developers. All Rights Reserved.