|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.etools.systems.core.ui.commands.SystemCmdSubstVarList
Field Summary | |
---|---|
static String |
copyright
|
static String |
SUBST_PREFIX
Typical substitution variable string prefix when using delimiters: "{" |
static char |
SUBST_PREFIX_AMP
Typical substitution variable prefix when using single prefix char: '&' |
static char |
SUBST_PREFIX_BRACE
Typical substitution variable char prefix when using delimiters: "{" |
static char |
SUBST_PREFIX_DOLLAR
Typical substitution variable char prefix when using delimiters: "$" |
static char |
SUBST_SUFFIX_BRACE
Typical substitution variable char suffix when using delimiters: "}" |
Constructor Summary | |
---|---|
SystemCmdSubstVarList(char prefix,
String[] names,
ResourceBundle rb,
String rbKeyRoot)
Constructor when using single prefix like '&' |
|
SystemCmdSubstVarList(String[] names,
ResourceBundle rb,
String rbKeyRoot)
Constructor when using ${xxx} delimiting, and not based on another list |
|
SystemCmdSubstVarList(SystemCmdSubstVarList commonList,
char prefix,
String[] names,
ResourceBundle rb,
String rbKeyRoot)
Constructor when using single prefix like '&', and based on another list Sometimes a substitution variable list contains common variables, plus some unique variables. |
|
SystemCmdSubstVarList(SystemCmdSubstVarList commonList,
String[] names,
ResourceBundle rb,
String rbKeyRoot)
Constructor when using ${xxx} delimiting, and we are based on another list |
Method Summary | |
---|---|
String[] |
doAllSubstitutions(Object context,
ISystemSubstitutor substitutor)
For testing purposes. |
String |
doSubstitutions(String commandString,
Object context,
ISystemSubstitutor substitutor)
Given a command string potentially containing substitution variables, and a context object that represents something currently selected (say), this will scan the command string for matches on any of the substitution variables defined in this list. |
String[] |
getDisplayStrings()
Return the list as an array of display strings of the form xx - some text |
SystemCmdSubstVar[] |
getListAsArray()
Return the list of variables as an array of SystemCmdSubstVar objects |
void |
init(SystemCmdSubstVarList commonList,
String[] names,
ResourceBundle rb,
String rbKeyRoot)
Abstraction of common stuff done by all constructors. |
void |
printDisplayStrings()
For debugging purposes, writes the list of variables to standard out |
void |
printDisplayStrings(PrintWriter stream)
For whatever purpose, writes the list of variables to given stream |
void |
testForDuplicates()
Helper method to test for duplicate variables |
String |
toString()
This writes out the class name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String copyright
public static final char SUBST_PREFIX_AMP
public static final char SUBST_PREFIX_DOLLAR
public static final char SUBST_PREFIX_BRACE
public static final String SUBST_PREFIX
public static final char SUBST_SUFFIX_BRACE
Constructor Detail |
public SystemCmdSubstVarList(char prefix, String[] names, ResourceBundle rb, String rbKeyRoot)
public SystemCmdSubstVarList(SystemCmdSubstVarList commonList, char prefix, String[] names, ResourceBundle rb, String rbKeyRoot)
public SystemCmdSubstVarList(String[] names, ResourceBundle rb, String rbKeyRoot)
public SystemCmdSubstVarList(SystemCmdSubstVarList commonList, String[] names, ResourceBundle rb, String rbKeyRoot)
Method Detail |
public void init(SystemCmdSubstVarList commonList, String[] names, ResourceBundle rb, String rbKeyRoot)
public SystemCmdSubstVar[] getListAsArray()
public String[] getDisplayStrings()
public void printDisplayStrings()
public void printDisplayStrings(PrintWriter stream)
public String doSubstitutions(String commandString, Object context, ISystemSubstitutor substitutor)
ISystemSubstitutor
to retrieve the value to
replace the substitution variable with. The substitutor is also given
the context object passed in here.
Currently this assume all variables use the prefix given in the constructor, as it optimizes performance. Another flavour would be needed if arbitrary prefixes were to supported!
Further, this also currently assumes a doubled up prefix is used for escaping, meaning the first prefix is to be removed, the next is to be left unsubstituted.
commandString
- - the command from the user action, that contains vars to be substitutedcontext
- - a selected objectsubstitutor
- - an object that knows how to do substitutions. A callback.public String[] doAllSubstitutions(Object context, ISystemSubstitutor substitutor)
context
- - a selected objectsubstitutor
- - an object that knows how to do substitutions. A callbackpublic void testForDuplicates()
public String toString()
|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |