abbot.script
Class PropertyCall

java.lang.Object
  |
  +--abbot.script.Step
        |
        +--abbot.script.Call
              |
              +--abbot.script.PropertyCall
All Implemented Interfaces:
Serializable, Tags, XMLifiable
Direct Known Subclasses:
Assert, Sample

public abstract class PropertyCall
extends Call

Provide select non-static method access in addition to standard Call capabilities. Specifically, allows specification of a ComponentReference to be used as the method invocation target. If a ComponentReference is given, then the class of the component reference is used as the target class.

This isn't a great name (and since it's a meta-class, it's easily changeable) but right now I can't think of one.

See Also:
Serialized Form

Fields inherited from interface abbot.script.Tags
TAG_ACTION, TAG_ARGS, TAG_ASSERT, TAG_AWTTESTSCRIPT, TAG_CALL, TAG_CLASS, TAG_CLASSPATH, TAG_COMMENT, TAG_COMPONENT, TAG_COUNT, TAG_DELEGATE, TAG_DESC, TAG_DOCBASE, TAG_EVENT, TAG_FILENAME, TAG_FORKED, TAG_HEIGHT, TAG_HORDER, TAG_ID, TAG_INDEX, TAG_INVERT, TAG_INVOKER, TAG_KEYCHAR, TAG_KEYCODE, TAG_KIND, TAG_LAUNCH, TAG_METHOD, TAG_MODIFIERS, TAG_NAME, TAG_PARAMS, TAG_PARENT, TAG_POLL_INTERVAL, TAG_PROPERTY, TAG_SAMPLE, TAG_SCRIPT, TAG_SEQUENCE, TAG_SLOW, TAG_STOP_ON_ERROR, TAG_STOP_ON_FAILURE, TAG_TAG, TAG_TERMINATE, TAG_THREADED, TAG_TIMEOUT, TAG_TITLE, TAG_TRIGGER, TAG_TYPE, TAG_VALUE, TAG_VMARGS, TAG_VORDER, TAG_WAIT, TAG_WIDTH, TAG_WINDOW, TAG_X, TAG_Y
 
Constructor Summary
PropertyCall(Resolver resolver, Map attributes)
          Create a PropertyCall based on loaded XML attributes.
PropertyCall(Resolver resolver, String description, String methodName, String[] args, String id)
          Create a PropertyCall with a Component target.
PropertyCall(Resolver resolver, String description, String className, String methodName, String[] args)
          Create a PropertyCall based on a static invocation.
 
Method Summary
 Map getAttributes()
          Save attributes specific to this Step class.
 String getComponentID()
          Return the component reference ID used by this method invocation.
protected  String getDefaultDescription()
          Return a reasonable default description for this script step.
protected  Object getTarget(Method m)
          Return the target of the method invocation.
static boolean isPropertyMethod(Method m)
          Returns whether the given method is a property accessor.
 void setComponentID(String id)
          Set the component reference ID used by method invocation.
 
Methods inherited from class abbot.script.Call
encode, getArgs, getEncodedArguments, getMethod, getMethodName, getTargetClass, getTargetClassName, getUsage, getXMLTag, invoke, resolveMethod, runStep, setArguments, setMethodName, setTargetClassName
 
Methods inherited from class abbot.script.Step
addAttributes, addContent, createAttributeMap, createStep, createStep, getDescription, getFinder, getResolver, parseStepAttributes, resolve, resolveClass, resolveTester, run, setDescription, setScriptError, simpleClassName, toEditableString, toString, toXML, toXMLString, usage, usage
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyCall

public PropertyCall(Resolver resolver,
                    Map attributes)
Create a PropertyCall based on loaded XML attributes.

PropertyCall

public PropertyCall(Resolver resolver,
                    String description,
                    String className,
                    String methodName,
                    String[] args)
Create a PropertyCall based on a static invocation.

PropertyCall

public PropertyCall(Resolver resolver,
                    String description,
                    String methodName,
                    String[] args,
                    String id)
Create a PropertyCall with a Component target.
Method Detail

getComponentID

public String getComponentID()
Return the component reference ID used by this method invocation.

setComponentID

public void setComponentID(String id)
Set the component reference ID used by method invocation. The class of the component referenced by the component reference will replace the current target class.

getAttributes

public Map getAttributes()
Save attributes specific to this Step class.
Overrides:
getAttributes in class Call

getTarget

protected Object getTarget(Method m)
                    throws Throwable
Return the target of the method invocation.
Overrides:
getTarget in class Call

isPropertyMethod

public static boolean isPropertyMethod(Method m)
Returns whether the given method is a property accessor. In addition to standard is/get/has property accessors, this includes pseudo-property methods on ComponentTester objects.

getDefaultDescription

protected String getDefaultDescription()
Description copied from class: Step
Return a reasonable default description for this script step. This value is used in the absence of an explicit description.
Overrides:
getDefaultDescription in class Call


Copyright © 2002-2003 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge