cookxml.core.stringhook
Class ResourceBundleStringHook
java.lang.Object
cookxml.core.stringhook.ResourceBundleStringHook
- All Implemented Interfaces:
- StringHook
- public class ResourceBundleStringHook
- extends Object
- implements StringHook
This StringHook class translate the string that starts with HOOK_CHAR (default to @)
using the resource bundle. If the resource string was not found or the string
does not start with the HOOK_CHAR, it is returned as is.
- Since:
- CookXml 1.0
- See Also:
StringHook
,
ResourceBundleSetter
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HOOK_CHAR
public static String HOOK_CHAR
ResourceBundleStringHook
public ResourceBundleStringHook(ResourceBundle bundle)
getTranslatedString
public String getTranslatedString(String tag,
Object obj,
String attr,
String value,
DecodeEngine decodeEngine)
- Description copied from interface:
StringHook
- this function is used to substitute a string specified in XML with a different string.
The main purpose of this function is to allow locale based string setup.
- Specified by:
getTranslatedString
in interface StringHook
- Parameters:
tag
- the parent tagobj
- the parent objectattr
- the attribute that this string is hooked tovalue
- the string value to be translateddecodeEngine
- the decodeEngine being used
- Returns:
- the substituted string or the original string.