|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clapper.util.text.MultipleMapVariableDereferencer
public class MultipleMapVariableDereferencer
/**
The MultipleMapVariableDereferencer class implements the VariableDereferencer interface and resolves variable references by looking them up in one or more supplied Map objects.
The keys and values in the supplied Map objects must be String objects.
If more than one contained map has a value for a specific key, the first map's value will be used. ("First", in this case, means the first map added to the MultipleMapVariableDereference object.)
VariableDereferencer,
VariableSubstituter,
MapVariableDereferencer| Constructor Summary | |
|---|---|
MultipleMapVariableDereferencer()
Creates a new instance of MultipleMapVariableDereferencer that has no associated Map objects. |
|
MultipleMapVariableDereferencer(java.util.Map<java.lang.String,java.lang.String>... maps)
Creates a new instance of MultipleMapVariableDereferencer that is initialized with a specified set of maps. |
|
| Method Summary | |
|---|---|
void |
addMap(java.util.Map<java.lang.String,java.lang.String> map)
Add a map to the list of maps to use when dereferencing variable values. |
java.lang.String |
getVariableValue(java.lang.String varName,
java.lang.Object context)
Get the value associated with a given variable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultipleMapVariableDereferencer()
addMap(java.util.Map) method.
public MultipleMapVariableDereferencer(java.util.Map<java.lang.String,java.lang.String>... maps)
maps - the maps to use| Method Detail |
|---|
public final void addMap(java.util.Map<java.lang.String,java.lang.String> map)
map - The map to add
public java.lang.String getVariableValue(java.lang.String varName,
java.lang.Object context)
getVariableValue in interface VariableDereferencervarName - 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.
Ignored here.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||