|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.digester.substitution.MultiVariableExpander
Expands variable references from multiple sources.
| Field Summary | |
private java.util.ArrayList |
markers
|
private int |
nEntries
|
private java.util.ArrayList |
sources
|
| Constructor Summary | |
MultiVariableExpander()
|
|
| Method Summary | |
void |
addSource(java.lang.String marker,
java.util.Map source)
|
java.lang.String |
expand(java.lang.String param)
Return the input string with any variables replaced by their corresponding value. |
java.lang.String |
expand(java.lang.String str,
java.lang.String marker,
java.util.Map source)
Replace any occurrences within the string of the form "marker{key}" with the value from source[key]. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private int nEntries
private java.util.ArrayList markers
private java.util.ArrayList sources
| Constructor Detail |
public MultiVariableExpander()
| Method Detail |
public void addSource(java.lang.String marker,
java.util.Map source)
public java.lang.String expand(java.lang.String param)
VariableExpander
expand in interface VariableExpander
public java.lang.String expand(java.lang.String str,
java.lang.String marker,
java.util.Map source)
Commonly, the variable marker is "$", in which case variables are indicated by ${key} in the string.
Returns the string after performing all substitutions.
If no substitutions were made, the input string object is returned (not a copy).
java.lang.IllegalArgumentException - if the input param references
a variable which is not known to the specified source.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||