cookxml.core.stringhook
Class ResourceBundleStringHook

java.lang.Object
  extended bycookxml.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

Field Summary
static String HOOK_CHAR
           
 
Constructor Summary
ResourceBundleStringHook(ResourceBundle bundle)
           
 
Method Summary
 String getTranslatedString(String tag, Object obj, String attr, String value, DecodeEngine decodeEngine)
          this function is used to substitute a string specified in XML with a different string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HOOK_CHAR

public static String HOOK_CHAR
Constructor Detail

ResourceBundleStringHook

public ResourceBundleStringHook(ResourceBundle bundle)
Method Detail

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 tag
obj - the parent object
attr - the attribute that this string is hooked to
value - the string value to be translated
decodeEngine - the decodeEngine being used
Returns:
the substituted string or the original string.