com.metamatrix.core.commandshell
Class ScriptReader

java.lang.Object
  extended by com.metamatrix.core.commandshell.ScriptReader

public class ScriptReader
extends java.lang.Object

Understands how to read specific command line scripts from a String containing multiple scripts.


Field Summary
static java.lang.String RESULT_KEYWORD
           
 
Constructor Summary
ScriptReader(java.lang.String scripts)
           
 
Method Summary
 boolean checkResults()
          Returns whether the last command line includes a specification of what the expected results are.
 java.lang.String getExpectedResults()
          If the last command line includes a specification of what the expected results are, then this method returns the expected value from the script.
 java.lang.String[] getScriptNames()
           
 void gotoScript(java.lang.String scriptName)
          Indicates which specific script is currently being referenced.
 boolean hasMore()
          Returns whether or not their are additional commands for the current script.
 java.lang.String nextCommandLine()
          Retrieve the next command line for the current script.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESULT_KEYWORD

public static java.lang.String RESULT_KEYWORD
Constructor Detail

ScriptReader

public ScriptReader(java.lang.String scripts)
Parameters:
scripts - A String containing many script definitions.
Method Detail

gotoScript

public void gotoScript(java.lang.String scriptName)
Indicates which specific script is currently being referenced.

Parameters:
scriptName - The name of the script to go to. This name should correspond to a name in the scripts String.

hasMore

public boolean hasMore()
Returns whether or not their are additional commands for the current script.


nextCommandLine

public java.lang.String nextCommandLine()
Retrieve the next command line for the current script.


checkResults

public boolean checkResults()
Returns whether the last command line includes a specification of what the expected results are.


getExpectedResults

public java.lang.String getExpectedResults()
If the last command line includes a specification of what the expected results are, then this method returns the expected value from the script.


getScriptNames

public java.lang.String[] getScriptNames()


Copyright © 2009. All Rights Reserved.