|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectabbot.script.Step
Provides access to one step (line) from a script. A Step is the basic unit of execution. All derived classes should have a tag "sampleStep" with a corresponding class abbot.script.SampleStep. The class must supply at least a Constructor with the signature SampleStep(Resolver, Map). If the step has contents (e.g. Sequence), then it should also provide a Constructor with the signature SampleStep(Resolver, Element, Map).
Field Summary |
Fields inherited from interface abbot.script.XMLConstants |
TAG_ACTION, TAG_APPLETVIEWER, TAG_ARCHIVE, TAG_ARGS, TAG_ASSERT, TAG_AWTTESTSCRIPT, TAG_BORDER_TITLE, TAG_CALL, TAG_CLASS, TAG_CLASSPATH, TAG_CODE, TAG_CODEBASE, TAG_COMMENT, TAG_COMPONENT, TAG_COUNT, TAG_DELEGATE, TAG_DESC, TAG_DOCBASE, TAG_EVENT, TAG_FILENAME, TAG_FORKED, TAG_HEIGHT, TAG_HORDER, TAG_ICON, TAG_ID, TAG_INDEX, TAG_INVERT, TAG_INVOKER, TAG_KEYCHAR, TAG_KEYCODE, TAG_KIND, TAG_LABEL, TAG_LAUNCH, TAG_METHOD, TAG_MODIFIERS, TAG_NAME, TAG_PARAMS, TAG_PARENT, TAG_POLL_INTERVAL, TAG_PROPERTY, TAG_ROOT, TAG_SAMPLE, TAG_SCRIPT, TAG_SEQUENCE, TAG_SLOW, TAG_STOP_ON_ERROR, TAG_STOP_ON_FAILURE, TAG_TAG, TAG_TERMINATE, TAG_TEXT, TAG_THREADED, TAG_TIMEOUT, TAG_TITLE, TAG_TRIGGER, TAG_TYPE, TAG_VALUE, TAG_VMARGS, TAG_VORDER, TAG_WAIT, TAG_WEIGHTED, TAG_WIDTH, TAG_WINDOW, TAG_X, TAG_Y |
Constructor Summary | |
Step(Resolver resolver,
Map attributes)
|
|
Step(Resolver resolver,
String description)
|
Method Summary | |
protected org.jdom.Element |
addAttributes(org.jdom.Element el)
|
protected org.jdom.Element |
addContent(org.jdom.Element el)
Override if the step actually has some contents. |
protected static Map |
createAttributeMap(org.jdom.Element el)
|
static Step |
createStep(Resolver resolver,
org.jdom.Element el)
Factory method, equivalent to a "fromXML" for step creation. |
static Step |
createStep(Resolver resolver,
String str)
Create a new step from an in-line XML string. |
Map |
getAttributes()
Attributes to save in script. |
abstract String |
getDefaultDescription()
Return a reasonable default description for this script step. |
String |
getDescription()
|
Resolver |
getResolver()
|
abstract String |
getUsage()
Provide a usage String for this step. |
abstract String |
getXMLTag()
Define the XML tag to use for this script step. |
protected void |
parseStepAttributes(Map attributes)
|
Class |
resolveClass(String className)
Returns the Class corresponding to the given class name. |
protected ComponentTester |
resolveTester(String className)
Look up an appropriate ComponentTester given an arbitrary Component-derived class. |
void |
run()
Main run method. |
protected abstract void |
runStep()
Implement the step's behavior here. |
void |
setDescription(String desc)
|
protected void |
setScriptError(Throwable thr)
For use by subclasses when an error is encountered during parsing. |
protected String |
simpleClassName(Class cls)
|
String |
toEditableString()
Provide an editable string representation of the object. |
String |
toString()
Return a description of this script step. |
org.jdom.Element |
toXML()
Convert the object to XML. |
static String |
toXMLString(XMLifiable obj)
Provide a one-line XML string representation. |
protected void |
usage()
Throw an invalid script exception describing the proper script usage. |
protected void |
usage(String details)
Store an invalid script exception describing the proper script usage. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Step(Resolver resolver, Map attributes)
public Step(Resolver resolver, String description)
Method Detail |
protected final void parseStepAttributes(Map attributes)
public final void run() throws Throwable
Throwable
protected abstract void runStep() throws Throwable
Throwable
public String getDescription()
public void setDescription(String desc)
public abstract String getXMLTag()
public abstract String getUsage()
public abstract String getDefaultDescription()
protected void setScriptError(Throwable thr)
protected void usage()
protected void usage(String details)
public Map getAttributes()
public Resolver getResolver()
protected org.jdom.Element addContent(org.jdom.Element el)
protected org.jdom.Element addAttributes(org.jdom.Element el)
public String toEditableString()
XMLifiable
toEditableString
in interface XMLifiable
public static String toXMLString(XMLifiable obj)
public org.jdom.Element toXML()
toXML
in interface XMLifiable
public static Step createStep(Resolver resolver, String str) throws InvalidScriptException
InvalidScriptException
protected static Map createAttributeMap(org.jdom.Element el)
public static Step createStep(Resolver resolver, org.jdom.Element el) throws InvalidScriptException
InvalidScriptException
protected String simpleClassName(Class cls)
public String toString()
public Class resolveClass(String className) throws ClassNotFoundException
ClassNotFoundException
protected ComponentTester resolveTester(String className) throws ClassNotFoundException
ClassNotFoundException
- If the given class can't be found.
IllegalArgumentException
- If the tester cannot be instantiated.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |