public abstract class VariableResolver extends java.lang.Object implements Translator
Translator that does variable resolution in the Ant style.
This implementation looks for variables in the string like
"${xyz}" or "${abc.DEF.ghi}". The getVariableValue(String) method
is then used to obtain the actual value for the variable.
"$$" works as the escape of "$", so for example "$${abc}" expands to "${abc}" where "${abc}" would have expanded to "value-of-abc". A lone "$" is left as-is, so "$abc" expands to "$abc".
NOOP, SYS_PROP_TR| Constructor and Description |
|---|
VariableResolver() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract java.lang.String |
getVariableValue(java.lang.String varName)
Returns the value of the variable.
|
java.lang.String |
translate(java.lang.String str) |
public java.lang.String translate(java.lang.String str)
throws TranslationException
translate in interface TranslatorTranslationExceptionprotected abstract java.lang.String getVariableValue(java.lang.String varName)
throws TranslationException
TranslationException,
which is an useful technique if the implementation would like to report
additional errors.TranslationExceptionCopyright © 2013 Oracle Corporation. All Rights Reserved.