org.clapper.util.text
Interface VariableDereferencer

All Known Implementing Classes:
Configuration, MapVariableDereferencer, MultipleMapVariableDereferencer

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.

Version:
$Revision: 6735 $
Author:
Copyright © 2004-2007 Brian M. Clapper
See Also:
MapVariableDereferencer, VariableSubstituter

Method Summary
 java.lang.String getVariableValue(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 VariableSubstitutionException
Get 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


Copyright © 2004-2007 Brian M. Clapper. All Rights Reserved.