org.tanukisoftware.wrapper
Class WrapperResources

java.lang.Object
  extended by org.tanukisoftware.wrapper.WrapperResources

public final class WrapperResources
extends Object

A resource bundle which is used to help localize applications to the default locale of the JVM. Resources are stored in MO files using the standard UNIX gettext resources. For example,

WrapperResources res = WrapperManager.loadWrapperResources( "myapp", "../lang/" ); To use the WrapperResources, make a call to any of the getString() methods. If the resource files are not found, or the specific key is not found then the key is returned unmodified.

Author:
Leif Mortenson

Constructor Summary
protected WrapperResources()
          WrapperResources instances are created using the WrapperManager.loadWrapperResources method.
 
Method Summary
protected  void finalize()
           
 String getString(String key)
          Request a localized version of the specified key.
 String getString(String key, Object arg0)
          Request a localized version of the specified key.
 String getString(String key, Object[] arguments)
          Request a localized version of the specified key.
 String getString(String key, Object arg0, Object arg1)
          Request a localized version of the specified key.
 String getString(String key, Object arg0, Object arg1, Object arg2)
          Request a localized version of the specified key.
 String getString(String key, Object arg0, Object arg1, Object arg2, Object arg3)
          Request a localized version of the specified key.
 String getString(String key, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4)
          Request a localized version of the specified key.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrapperResources

protected WrapperResources()
WrapperResources instances are created using the WrapperManager.loadWrapperResources method.

Method Detail

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

getString

public String getString(String key)
Request a localized version of the specified key.

Parameters:
key - Resource to be localized.
Returns:
The localized version of the key.

getString

public String getString(String key,
                        Object[] arguments)
Request a localized version of the specified key.

Individual tokens will be replaced with the specified parameters using the Java MessageFormat format method.

Parameters:
key - Resource to be localized.
arguments - An array of argumens to be replaced in the resource.
Returns:
The localized version of the key.
See Also:
MessageFormat

getString

public String getString(String key,
                        Object arg0)
Request a localized version of the specified key.

Individual tokens will be replaced with the specified parameters using the Java MessageFormat format method.

Parameters:
key - Resource to be localized.
arg0 - An argument to be replaced in the resource.
Returns:
The localized version of the key.
See Also:
MessageFormat

getString

public String getString(String key,
                        Object arg0,
                        Object arg1)
Request a localized version of the specified key.

Individual tokens will be replaced with the specified parameters using the Java MessageFormat format method.

Parameters:
key - Resource to be localized.
arg0 - An argument to be replaced in the resource.
arg1 - An argument to be replaced in the resource.
Returns:
The localized version of the key.
See Also:
MessageFormat

getString

public String getString(String key,
                        Object arg0,
                        Object arg1,
                        Object arg2)
Request a localized version of the specified key.

Individual tokens will be replaced with the specified parameters using the Java MessageFormat format method.

Parameters:
key - Resource to be localized.
arg0 - An argument to be replaced in the resource.
arg1 - An argument to be replaced in the resource.
arg2 - An argument to be replaced in the resource.
Returns:
The localized version of the key.
See Also:
MessageFormat

getString

public String getString(String key,
                        Object arg0,
                        Object arg1,
                        Object arg2,
                        Object arg3)
Request a localized version of the specified key.

Individual tokens will be replaced with the specified parameters using the Java MessageFormat format method.

Parameters:
key - Resource to be localized.
arg0 - An argument to be replaced in the resource.
arg1 - An argument to be replaced in the resource.
arg2 - An argument to be replaced in the resource.
arg3 - An argument to be replaced in the resource.
Returns:
The localized version of the key.
See Also:
MessageFormat

getString

public String getString(String key,
                        Object arg0,
                        Object arg1,
                        Object arg2,
                        Object arg3,
                        Object arg4)
Request a localized version of the specified key.

Individual tokens will be replaced with the specified parameters using the Java MessageFormat format method.

Parameters:
key - Resource to be localized.
arg0 - An argument to be replaced in the resource.
arg1 - An argument to be replaced in the resource.
arg2 - An argument to be replaced in the resource.
arg3 - An argument to be replaced in the resource.
arg4 - An argument to be replaced in the resource.
Returns:
The localized version of the key.
See Also:
MessageFormat


Copyright 1999, 2010 Tanuki Software Inc., All Rights Reserved.