com.ptc.windchill.upgrade.directives
Class ParameterizedString

java.lang.Object
  extended bycom.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} 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

Nested Class Summary
private static class ParameterizedString.ClassNameToClassNamePart
           
private static class ParameterizedString.ClassNameToTablePart
           
private static class ParameterizedString.ColumnDescriptorToColumnName
           
private static interface ParameterizedString.StringPart
           
private static class ParameterizedString.VerbatimPart
           
 
Field Summary
private  ArrayList parts_
           
 
Constructor Summary
ParameterizedString()
           
ParameterizedString(String source_string)
           
 
Method Summary
private  String[] createMacroArgsFrom(String macro)
           
private  ParameterizedString.StringPart createPartFrom(String macro, int offset)
           
 String evaluate()
           
private  String getMacroIdFor(String macro)
           
 String getSourceString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parts_

private ArrayList parts_
Constructor Detail

ParameterizedString

public ParameterizedString()

ParameterizedString

public ParameterizedString(String source_string)
                    throws ParseException
Method Detail

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