com.ptc.windchill.upgrade.directives
Class ParameterizedString
java.lang.Object
com.ptc.windchill.upgrade.directives.ParameterizedString
- public class ParameterizedString
- extends Object
Works in conjunction with the ParameterizedStringScope
and an
UpdateDirective
which will configure the scope such as
ForEachConcreteImplementorOf
to allow you to parameterize a
string using the ClassInfo that is in scope.
A parameterized string is essentially a string containing macros delimited
by curly braces. These macros are identifies during construction. They
will be replaced with values when the string is evaluated. When
the method evaluate
is called, the macros are executed
and will pull useful information from the current ParameterizedStringScope
and the resulting strings are concatenated back together into a complete
string.
Currently supported macros are:
- {ClassName}
- {Class}
- {ColumnDescriptor:name
{ClassName}
will evaluate to the name of the class
that is in scope according to the ParameterizedStringScope
.
{Class}
will evaluate to the name of the database table
corresponding to the class that is in scope according to the
ParameterizedStringScope
.
{ColumnDescriptor:name}>/code> evaluates to the column name
of the column descriptor with the specified name on the class that is in
scope according to the ParameterizedStringScope
.
See the class ForEachConcreteImplementorOf
for an example of how
to use parameterization.
- See Also:
ForEachConcreteImplementorOf
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
parts_
private ArrayList parts_
ParameterizedString
public ParameterizedString()
ParameterizedString
public ParameterizedString(String source_string)
throws ParseException
createPartFrom
private ParameterizedString.StringPart createPartFrom(String macro,
int offset)
throws ParseException
- Throws:
ParseException
getMacroIdFor
private String getMacroIdFor(String macro)
createMacroArgsFrom
private String[] createMacroArgsFrom(String macro)
getSourceString
public String getSourceString()
evaluate
public String evaluate()
throws ParameterizedStringException
- Throws:
ParameterizedStringException