|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.exoftware.exactor.Script
A collection of commands to be executed together. The script contains a context map that is accessible to all the commands contained in the script.
Constructor Summary | |
Script()
Create a new script. |
|
Script(java.io.File scriptFile)
Create a new script with the specified scriptFile. |
Method Summary | |
void |
addCommand(Command c)
Add a command to the script. |
int |
countCommands()
Returns the number of commands added to the script. |
void |
execute()
Execute all the commands in the script. |
java.lang.String |
getAbsolutePath()
Returns the full path of the script file. |
Command |
getCommand(int index)
Returns the command at the specified index. |
java.util.Map |
getContext()
Returns the context for all commands in this script. |
ExecutionSet |
getExecutionSet()
Returns the ExecutionSet containing this script. |
java.lang.String |
getName()
Returns the name of the script. |
boolean |
hasCommands()
Check whether the script has any commands. |
void |
replaceCommand(Command command,
Command replacement)
Replace one command with another command. |
void |
setExecutionSet(ExecutionSet s)
Set the ExecutionSet that contains this script. |
void |
substituteParameters(Parameter[] substitutions)
Substitute the specified substitutions for all
commands in the script. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Script()
public Script(java.io.File scriptFile)
scriptFile
- the file containing the script.Method Detail |
public java.lang.String getName()
public java.lang.String getAbsolutePath()
public ExecutionSet getExecutionSet()
public void setExecutionSet(ExecutionSet s)
s
- the ExecutionSet that contains this script.public java.util.Map getContext()
public void addCommand(Command c)
c
- the command to add.public boolean hasCommands()
true
if the script contains commands,
otherwise false
.public int countCommands()
public Command getCommand(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the command to return.
java.lang.IndexOutOfBoundsException
- if the command has no parameters, or
if the index is out of range (index < 0 || index >= countCommands()).public void replaceCommand(Command command, Command replacement) throws java.lang.NullPointerException, java.lang.IllegalStateException
command
- the command to replace.replacement
- the replacement command.
java.lang.RuntimeException
- if either command or replacement are null
or
if command is not contained in this script
java.lang.NullPointerException
java.lang.IllegalStateException
public void execute()
public void substituteParameters(Parameter[] substitutions)
substitutions
for all
commands in the script.
substitutions
- the array of parameters to use for substitutions.Command.substituteParameters(Parameter[])
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |