org.clapper.util.text
Interface VariableDereferencer
-
- All Known Implementing Classes:
- Configuration, MapVariableDereferencer, MultipleMapVariableDereferencer
public interface VariableDereferencerThe
VariableDereferencerinterface 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 withVariableSubstituterobjects to resolve variable references in strings.The values for referenced variables can come from anywhere (in a
Propertiesobject, via direct method calls, from a symbol table, etc.), provided the values can be located using only the variable's name.- See Also:
MapVariableDereferencer,VariableSubstituter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description java.lang.StringgetVariableValue(java.lang.String varName, java.lang.Object context)Get the value associated with a given variable.
-
-
-
Method Detail
-
getVariableValue
java.lang.String getVariableValue(java.lang.String varName, java.lang.Object context) throws VariableSubstitutionExceptionGet the value associated with a given variable.- Parameters:
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.- Returns:
- The variable's value. If the variable has no value, this method must return null.
- Throws:
VariableSubstitutionException- substitution error
-
-
DMelt 3.0 © DataMelt by jWork.ORG