WUI : API


org.westofj.wui
Class WResources

java.lang.Object
  extended byorg.westofj.wui.WResources

public final class WResources
extends Object

Provides access to values within resource bundles.

Version:
$Revision: 1.2 $, $Date: 2004/03/08 01:57:35 $
Author:
bill

Method Summary
static void clear()
          Clears the internal resource bundle cache.
static ResourceBundle getBundle(Locale locale, String bundleName)
          Returns a resource bundle for the specified bundle name and locale.
static String getText(Locale locale, String bundleName, String key)
          Returns text for the specified resource.
static String getText(Locale locale, String bundleName, String key, List args)
          Returns text for the specified resource constructed with the specified arguments.
static String getText(Locale locale, String bundleName, String key, Object arg0)
          Returns text for the specified resource constructed with the specified argument.
static String getText(Locale locale, String bundleName, String key, Object[] args)
          Returns text for the specified resource constructed with the specified arguments.
static String getText(Locale locale, String bundleName, String key, Object arg0, Object arg1)
          Returns text for the specified resource constructed with the specified arguments.
static String getText(Locale locale, String bundleName, String key, Object arg0, Object arg1, Object arg2)
          Returns text for the specified resource constructed with the specified arguments.
static boolean isCacheOn()
          Returns true if resource bundle caching is on, false otherwise.
static void setCacheOn(boolean cacheOn)
          Turns resource bundle caching on or off.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBundle

public static ResourceBundle getBundle(Locale locale,
                                       String bundleName)
Returns a resource bundle for the specified bundle name and locale.

Parameters:
locale - the locale.
bundleName - the name of the bundle.
Returns:
ResourceBundle

getText

public static String getText(Locale locale,
                             String bundleName,
                             String key)
Returns text for the specified resource.

Parameters:
locale - the locale.
bundleName - the name of the resource bundle.
key - the name of the resource.
Returns:
String the text for the specified resource.

getText

public static String getText(Locale locale,
                             String bundleName,
                             String key,
                             Object[] args)
Returns text for the specified resource constructed with the specified arguments.

Parameters:
locale - the locale.
bundleName - the name of the resource bundle.
key - the name of the resource.
args - the arguments with which to construct the resulting text.
Returns:
String the text for the specified resource.

getText

public static String getText(Locale locale,
                             String bundleName,
                             String key,
                             List args)
Returns text for the specified resource constructed with the specified arguments.

Parameters:
locale - the locale.
bundleName - the name of the resource bundle.
key - the name of the resource.
args - the arguments with which to construct the resulting text.
Returns:
String the text for the specified resource.

getText

public static String getText(Locale locale,
                             String bundleName,
                             String key,
                             Object arg0)
Returns text for the specified resource constructed with the specified argument.

Parameters:
locale - the locale.
bundleName - the name of the resource bundle.
key - the name of the resource.
arg0 - the argument with which to construct the resulting text.
Returns:
String the text for the specified resource.

getText

public static String getText(Locale locale,
                             String bundleName,
                             String key,
                             Object arg0,
                             Object arg1)
Returns text for the specified resource constructed with the specified arguments.

Parameters:
locale - the locale.
bundleName - the name of the resource bundle.
key - the name of the resource.
arg0 - the first argument with which to construct the resulting text.
arg1 - the second argument with which to construct the resulting text.
Returns:
String the text for the specified resource.

getText

public static String getText(Locale locale,
                             String bundleName,
                             String key,
                             Object arg0,
                             Object arg1,
                             Object arg2)
Returns text for the specified resource constructed with the specified arguments.

Parameters:
locale - the locale.
bundleName - the name of the resource bundle.
key - the name of the resource.
arg0 - the first argument with which to construct the resulting text.
arg1 - the second argument with which to construct the resulting text.
arg2 - the third argument with which to construct the resulting text.
Returns:
String the text for the specified resource.

isCacheOn

public static boolean isCacheOn()
Returns true if resource bundle caching is on, false otherwise.

Returns:
boolean true if resource bundle caching is on, false otherwise.

setCacheOn

public static void setCacheOn(boolean cacheOn)
Turns resource bundle caching on or off.

Parameters:
cacheOn - true indicates caching is on, false indicates caching is off.

clear

public static void clear()
Clears the internal resource bundle cache.


Copyright (c) 2003 West of J - All rights reserved.