Class WrapperResources
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
- Author:
- Tanuki Software Development Team <support@tanukisoftware.com>
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
WrapperResources instances are created using the WrapperManager.loadWrapperResources method. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
finalize()
Request a localized version of the specified key.Request a localized version of the specified key.Request a localized version of the specified key.Request a localized version of the specified key.Request a localized version of the specified key.Request a localized version of the specified key.Request a localized version of the specified key.
-
Constructor Details
-
WrapperResources
protected WrapperResources()WrapperResources instances are created using the WrapperManager.loadWrapperResources method.
-
-
Method Details
-
finalize
-
getString
Request a localized version of the specified key.- Parameters:
key
- Resource to be localized.- Returns:
- The localized version of the key.
-
getString
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:
-
getString
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:
-
getString
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:
-
getString
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:
-
getString
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:
-
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:
-