public interface VariableDereferencer
The VariableDereferencer
interface defines the behavior
of classes that can look up variables by name, returning their values.
It is used primarily to mark classes that can work hand-in-hand with
VariableSubstituter
objects to resolve variable references
in strings.
The values for referenced variables can come from anywhere (in a
Properties
object, via direct method calls, from a symbol
table, etc.), provided the values can be located using only the
variable's name.
MapVariableDereferencer
,
VariableSubstituter
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getVariableValue(java.lang.String varName,
java.lang.Object context)
Get the value associated with a given variable.
|
java.lang.String getVariableValue(java.lang.String varName, java.lang.Object context) throws VariableSubstitutionException
varName
- The name of the variable for which the value is
desired.context
- a context object, passed through from the caller
to the dereferencer, or null if there isn't one.VariableSubstitutionException
- substitution error