|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ibm.di.util.ParameterSubstitution
public class ParameterSubstitution
This class provides the "Parameter Substitution" features of TDI. If you are expanding a pattern only once you can use the static method. If you expand a pattern more than once using different params, you could create an instance and call substitute(Map) to avoid parsing the template for every call. The substitute call uses a Map object where you provide the available objects for pattern expansion. You should at least provide "mc=MetamergeConfig" or "config=BaseConfiguration" object, otherwise expansion of TDI-properties will not work. If you want to expand alcomponent parameters, you need to provide a "config=BaseConfiguration" object.
expression = system.getTDIExpression("{work.cn} {property.myprop}");
map = new java.util.HashMap();
map.put("mc", main.getMetamergeConfig());
while ( (work = nextentry()) != null ) {
map.put("work", work);
task.logmsg(expression.substitute(map));
}
| Constructor Summary | |
|---|---|
ParameterSubstitution(String pattern)
This constructor parses the pattern string for use in subsequent substitute calls. |
|
| Method Summary | |
|---|---|
static void |
main(String[] args)
|
String |
substitute(Map params)
This method expands the current pattern string using params as source for substitution values. |
String |
substitute(Map params,
List incref)
|
static String |
substitute(String pattern,
Map params)
This method performs a one-time parsing and substitution of pattern with the objects available in params. |
static String |
substitute(String pattern,
Map params,
List cref)
This method performs a one-time parsing and substitution of pattern with the objects available in params. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ParameterSubstitution(String pattern)
throws Exception
pattern - The pattern string to expand
Exception| Method Detail |
|---|
public String substitute(Map params)
throws Exception
params - The available objects (e.g. conn, work, task etc)
Exception
public String substitute(Map params,
List incref)
throws Exception
Exception
public static String substitute(String pattern,
Map params)
throws Exception
pattern - The pattern string to expandparams - The available objects (e.g. conn, work, task etc)
Exception
public static String substitute(String pattern,
Map params,
List cref)
throws Exception
pattern - The pattern string to expandparams - The available objects (e.g. conn, work, task etc)
" @param cref The list of previously used config object expressions (avoid circular references)
Exception
public static void main(String[] args)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||