public final class WrapperResources
extends java.lang.Object
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.
All resource keys passed to getString()
will be processed using the
java.util.MessageFormat class. As such, single quotes must be escaped.
This class can optionally validate all such keys and logs warnings about
keys which fail these checks. It is possible to enable this validation with
the following property. (Defaults to FALSE)
-Dorg.tanukisoftware.wrapper.WrapperResources.validateResourceKeys=TRUE
Modifier | Constructor and Description |
---|---|
protected |
WrapperResources()
WrapperResources instances are created using the WrapperManager.loadWrapperResources method.
|
Modifier and Type | Method and Description |
---|---|
protected void |
finalize() |
java.lang.String |
getString(java.lang.String key)
Request a localized version of the specified key.
|
java.lang.String |
getString(java.lang.String key,
java.lang.Object arg0)
Request a localized version of the specified key.
|
java.lang.String |
getString(java.lang.String key,
java.lang.Object[] arguments)
Request a localized version of the specified key.
|
java.lang.String |
getString(java.lang.String key,
java.lang.Object arg0,
java.lang.Object arg1)
Request a localized version of the specified key.
|
java.lang.String |
getString(java.lang.String key,
java.lang.Object arg0,
java.lang.Object arg1,
java.lang.Object arg2)
Request a localized version of the specified key.
|
java.lang.String |
getString(java.lang.String key,
java.lang.Object arg0,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
Request a localized version of the specified key.
|
java.lang.String |
getString(java.lang.String key,
java.lang.Object arg0,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
Request a localized version of the specified key.
|
protected WrapperResources()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public java.lang.String getString(java.lang.String key)
key
- Resource to be localized.public java.lang.String getString(java.lang.String key, java.lang.Object[] arguments)
Individual tokens will be replaced with the specified parameters using the Java MessageFormat format method.
key
- Resource to be localized.arguments
- An array of argumens to be replaced in the resource.MessageFormat
public java.lang.String getString(java.lang.String key, java.lang.Object arg0)
Individual tokens will be replaced with the specified parameters using the Java MessageFormat format method.
key
- Resource to be localized.arg0
- An argument to be replaced in the resource.MessageFormat
public java.lang.String getString(java.lang.String key, java.lang.Object arg0, java.lang.Object arg1)
Individual tokens will be replaced with the specified parameters using the Java MessageFormat format method.
key
- Resource to be localized.arg0
- An argument to be replaced in the resource.arg1
- An argument to be replaced in the resource.MessageFormat
public java.lang.String getString(java.lang.String key, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2)
Individual tokens will be replaced with the specified parameters using the Java MessageFormat format method.
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.MessageFormat
public java.lang.String getString(java.lang.String key, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
Individual tokens will be replaced with the specified parameters using the Java MessageFormat format method.
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.MessageFormat
public java.lang.String getString(java.lang.String key, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
Individual tokens will be replaced with the specified parameters using the Java MessageFormat format method.
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.MessageFormat
Copyright 1999, 2024 Tanuki Software Inc., All Rights Reserved.