| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.digester3.substitution.MultiVariableExpander
public class MultiVariableExpander
Expands variable references from multiple sources.
| Constructor Summary | |
|---|---|
MultiVariableExpander()
 | 
|
| Method Summary | |
|---|---|
 void | 
addSource(String marker,
                   Map<String,Object> source)
Add a new variables source, identified by the input marker  | 
 String | 
expand(String param)
Return the input string with any variables replaced by their corresponding value.  | 
 String | 
expand(String str,
             String marker,
             Map<String,Object> 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 | 
| Constructor Detail | 
|---|
public MultiVariableExpander()
| Method Detail | 
|---|
public void addSource(String marker,
                      Map<String,Object> source)
marker - The input variables markersource - The variables sourcepublic String expand(String param)
expand in interface VariableExpanderparam - the string containing variables to be replaced.
public String expand(String str,
                     String marker,
                     Map<String,Object> 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).
str - The input string containing placeholdersmarker - The input variables markersource - The variables source
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||