| java.lang.Object abbot.script.Step
All known Subclasses: abbot.script.Sequence, abbot.script.Terminate, abbot.script.Call, abbot.script.Annotation, abbot.script.Comment, abbot.script.Event, abbot.script.Expression,
Step | abstract public class Step implements XMLConstants,XMLifiable,Serializable(Code) | | Provides access to one step (line) from a script. A Step is the basic
unit of execution.
Custom Step classes
All custom
Step classes must supply a
Constructor with the
signature <init>(${link Resolver},
Map ) . If
the step has contents (e.g.
Sequence ), then it should also
provide a
Constructor with the signature
<init>(
Resolver ,
Element ,
Map ) .
The XML tag for a given
Step will be used to auto-generate the
Step class name, e.g. the tag <aphrodite/> causes the
parser to create an instance of class abbot.script.Aphrodite ,
using one of the
Constructor s described above.
All derived classes should include an entry in the
schema, or validation must be turned
off by setting the System property
abbot.script.validate=false .
You can make the custom Aphrodite step do just about anything
by overriding the
Step.runStep() method.
See the source for any
Step implementation in this package for
examples.
|
addAttributes | protected Element addAttributes(Element el)(Code) | | Add an attribute to the given XML Element. Attributes are kept in
alphabetical order.
|
addContent | protected Element addContent(Element el)(Code) | | Override if the step actually has some contents. In most cases, it
won't.
|
createAttributeMap | protected static Map createAttributeMap(Element el)(Code) | | Convert the attributes in the given XML Element into a Map of
name/value pairs.
|
createStep | public static Step createStep(Resolver resolver, Element el) throws InvalidScriptException(Code) | | Factory method, equivalent to a "fromXML" for step creation. Looks for
a class with the same name as the XML tag, with the first letter
capitalized. For example, <call /> is abbot.script.Call.
|
getAttributes | public Map getAttributes()(Code) | | Attributes to save in script.
|
getDefaultDescription | abstract public String getDefaultDescription()(Code) | | Return a reasonable default description for this script step.
This value is used in the absence of an explicit description.
|
getUsage | abstract public String getUsage()(Code) | | Provide a usage String for this step.
|
getXMLTag | abstract public String getXMLTag()(Code) | | Define the XML tag to use for this script step.
|
parseStepAttributes | final protected void parseStepAttributes(Map attributes)(Code) | | Only exposed so that Script may invoke it on load from disk.
|
resolveClass | public Class resolveClass(String className) throws ClassNotFoundException(Code) | | Returns the Class corresponding to the given class name. Provides
just-in-time classname resolution to ensure loading by the proper class
loader.
|
resolveTester | protected ComponentTester resolveTester(String className) throws ClassNotFoundException(Code) | | Look up an appropriate ComponentTester given an arbitrary
Component-derived class.
If the class is derived from abbot.tester.ComponentTester, instantiate
one; if it is derived from java.awt.Component, return a matching Tester.
Otherwise return abbot.tester.ComponentTester.
throws: ClassNotFoundException - If the given class can't be found. throws: IllegalArgumentException - If the tester cannot be instantiated. |
run | final public void run() throws Throwable(Code) | | Main run method. Should never be run on the event dispatch
thread, although no check is explicitly done here.
|
runStep | abstract protected void runStep() throws Throwable(Code) | | Implement the step's behavior here.
|
setScriptError | protected void setScriptError(Throwable thr)(Code) | | For use by subclasses when an error is encountered during parsing.
Should only be used by the XML parsing ctors.
|
toEditableString | public String toEditableString()(Code) | | Convert this Step into a String suitable for editing. The default is
the XML representation of the Step.
|
toString | public String toString()(Code) | | Return a description of this script step.
|
toXML | public Element toXML()(Code) | | Convert the object to XML.
|
toXMLString | public static String toXMLString(XMLifiable obj)(Code) | | Provide a one-line XML string representation.
|
usage | protected void usage()(Code) | | Throw an invalid script exception describing the proper script
usage. This should be used by derived classes whenever parsing
indicates invalid input.
|
usage | protected void usage(String details)(Code) | | Store an invalid script exception describing the proper script
usage. This should be used by derived classes whenever parsing
indicates invalid input.
|
|
|