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
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 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.