cookxml.core.interfaces
Interface StringHook

All Known Implementing Classes:
ResourceBundleStringHook

public interface StringHook

This interface is used to intercept the string values obtained in the xml document. The primary purpose is to allow locale based text to be set. Although it is probably a better idea to use entity resolver instead, using StringHook is simpler.

Since:
CookXml 1.0

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.
 

Method Detail

getTranslatedString

public 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. The main purpose of this function is to allow locale based string setup.

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.