org.safs.jvmagent
Interface LocalAgent

All Known Subinterfaces:
LocalServer
All Known Implementing Classes:
AServerImpl, ComponentAgent, ComponentAgent, ContainerAgent, ContainerAgent, FrameAgent, FrameAgent, JCheckBoxAgent, JCheckBoxAgent, JChildlessAgent, JComboBoxAgent, JComboBoxAgent, JComponentAgent, JComponentAgent, JFrameAgent, JFrameAgent, JLabelAgent, JLabelAgent, JListAgent, JListAgent, JMenuAgent, JMenuAgent, JMenuBarAgent, JMenuBarAgent, JScrollBarAgent, JScrollBarAgent, JScrollPaneAgent, JScrollPaneAgent, JTableAgent, JTableAgent, JTableHeaderAgent, JTableHeaderAgent, JTextAreaAgent, JTextAreaAgent, JTextFieldAgent, JTextFieldAgent, JTreeAgent, JTreeAgent, ObjectAgent, ObjectAgent, ServerImpl, STAFLocalServer, WindowAgent, WindowAgent

public interface LocalAgent

Since:
FEB 16, 2005 Feb 17, 2006 (Szucs) extending the prototypes of the methods getMatchingPathObject( ) and isMatchingPath( ) with Exception to unify them among the relevant interfaces

Method Summary
 java.lang.String getCaption(java.lang.Object object)
          Retrieve the Caption of the object if one exits.
 int getChildCount(java.lang.Object parent)
          Return the number of children available in the provided parent.
 java.lang.Object[] getChildren(java.lang.Object parent)
          Return an array representing the children of the provided parent object.
 java.lang.String getClassName(java.lang.Object object)
          Return the Class name of the object.
 java.lang.String getID(java.lang.Object object)
          Retrieve the ID of the object if the object has an ID.
 int getLevel(java.lang.Object object)
          Return the Z-Order level of the object (generally for a top level window).
 java.lang.Object getMatchingPathObject(java.lang.Object theObject, java.lang.String thePath)
          Mechanism to retrieve a subitem/object identified by the provided Path.
 java.lang.String getName(java.lang.Object object)
          Retrieve the name of the object if the object is named.
 java.lang.String getProperty(java.lang.Object object, java.lang.String property)
          Retrieve the property value of the object if the object has the property.
 java.lang.String[] getPropertyNames(java.lang.Object object)
          Retrieve the list of available properties for the object.
 java.lang.String[][] getStringData(java.lang.Object object, java.lang.Object dataInfo)
          Return whatever data is extractable (normally visible) from the object.
 java.lang.String[] getSuperClassNames(java.lang.Object object)
          Return the array of all superclass names for the object.
 java.lang.String getText(java.lang.Object object)
          Retrieve the displayed text value of the object if the object has a text value.
 boolean isMatchingPath(java.lang.Object theObject, java.lang.String thePath)
          Mechanism to determine if the object contains a subitem/object identified by the provided Path.
 boolean isShowing(java.lang.Object object)
          Return true if the object is showing/visible.
 boolean isValid(java.lang.Object object)
          Return true if the object is still valid/finadable in the JVM.
 TestRecordData process(java.lang.Object object, TestRecordData testRecordData)
          Process the action provided in the testRecordData.
 

Method Detail

getChildCount

int getChildCount(java.lang.Object parent)
Return the number of children available in the provided parent.


getChildren

java.lang.Object[] getChildren(java.lang.Object parent)
Return an array representing the children of the provided parent object.

Parameters:
parent - An object from getTopLevelWindows or from a previous call to getChildren. The parent is often one of the elements of the TopLevelWindow array or somewhere lower in that same hierarchy.
Returns:
Object[] representing all known children of the provided parent. This array will be Server/Agent specific and may be nothing more than arrays of the hashcodes used to uniquely identify objects in an Agent-maintained Hashtable. A zero-length array will be returned if the parent has no children.

getCaption

java.lang.String getCaption(java.lang.Object object)
Retrieve the Caption of the object if one exits.

Parameters:
object - An object from getTopLevelWindows or from a previous call to getChildren.
Returns:
String the caption of the object.

getName

java.lang.String getName(java.lang.Object object)
Retrieve the name of the object if the object is named.

Parameters:
object - An object from getTopLevelWindows or from a previous call to getChildren.
Returns:
String the name of the object.

getID

java.lang.String getID(java.lang.Object object)
Retrieve the ID of the object if the object has an ID.

Parameters:
object - An object from getTopLevelWindows or from a previous call to getChildren.
Returns:
String the ID of the object.

getText

java.lang.String getText(java.lang.Object object)
Retrieve the displayed text value of the object if the object has a text value.

Parameters:
object - An object from getTopLevelWindows or from a previous call to getChildren.
Returns:
String the text value of the object. Since text values can theoretically legally be zero-length, a null value will be returned if no value exists for the object.

getPropertyNames

java.lang.String[] getPropertyNames(java.lang.Object object)
Retrieve the list of available properties for the object.

Parameters:
object - An object from getTopLevelWindows or from a previous call to getChildren.
Returns:
String[] the names of available properties.

getProperty

java.lang.String getProperty(java.lang.Object object,
                             java.lang.String property)
                             throws NoSuchPropertyException
Retrieve the property value of the object if the object has the property.

Parameters:
object - -- An object from getTopLevelWindows or from a previous call to getChildren.
property - -- the case-sensitive name of the property to seek.
Returns:
String the text value of the object property. Since property values can theoretically legally be zero-length, a null value will be returned if no value exists for the object.
Throws:
NoSuchPropertyException

getClassName

java.lang.String getClassName(java.lang.Object object)
Return the Class name of the object. For example, we may get "javax.swing.JFrame" or the name of the subclass if it is a subclass of JFrame.

Parameters:
object - An object from getTopLevelWindows or from a previous call to getChildren.
Returns:
String Class name of the object.

getLevel

int getLevel(java.lang.Object object)
Return the Z-Order level of the object (generally for a top level window).

Parameters:
object - An object from getTopLevelWindows or from a previous call to getChildren.
Returns:
int z-order value of the object among all objects if this can be determined. 0 normally indicates the topmost Window. 1 is normally the Window behind that, etc..

isShowing

boolean isShowing(java.lang.Object object)
Return true if the object is showing/visible.

Parameters:
object - An object from getTopLevelWindows or from a previous call to getChildren.
Returns:
boolean true if the object is showing/visible.

isValid

boolean isValid(java.lang.Object object)
Return true if the object is still valid/finadable in the JVM.

Parameters:
object - An object from getTopLevelWindows or from a previous call to getChildren.
Returns:
boolean true if the object is still valid/findable.

getSuperClassNames

java.lang.String[] getSuperClassNames(java.lang.Object object)
Return the array of all superclass names for the object. This should return the Class hierarchy for the object all the way to Class Object. A 0-length array will be returned if there are none (Class Object).

Parameters:
object - An object from getTopLevelWindows or from a previous call to getChildren.
Returns:
String[] Class names for the superclass hierarchy.

getMatchingPathObject

java.lang.Object getMatchingPathObject(java.lang.Object theObject,
                                       java.lang.String thePath)
                                       throws java.lang.Exception
Mechanism to retrieve a subitem/object identified by the provided Path. Path is hierarchical information showing parent->child relationships separated by '->'. This is often used in Menus and Trees.

Ex:

File->Exit
Root->Branch->Leaf

Parameters:
theObject--Object - proxy for the object to be evaluated.
thePath - information to locate another object or subitem relative to theObject. this is usually something like a menuitem or tree node where supported.
Returns:
Object child sub-object found relative to theObject
Throws:
java.lang.Exception

isMatchingPath

boolean isMatchingPath(java.lang.Object theObject,
                       java.lang.String thePath)
                       throws java.lang.Exception
Mechanism to determine if the object contains a subitem/object identified by the provided Path. Path is hierarchical information showing parent->child relationships separated by '->'. This is often used in Menus and Trees.

Ex:

File->Exit
Root->Branch->Leaf

Parameters:
theObject--Object - proxy for the object to be evaluated.
thePath - information to locate another object or subitem relative to theObject. this is usually something like a menuitem or tree node where supported.
Returns:
true if the child sub-object was found relative to theObject.
Throws:
java.lang.Exception

getStringData

java.lang.String[][] getStringData(java.lang.Object object,
                                   java.lang.Object dataInfo)
Return whatever data is extractable (normally visible) from the object. Some objects like Lists may only require 1D of the 2D array. Some objects like Tables will use the full 2D array. Objects like Trees may use special techniques of storing their multi-dimensional data in the 2D array.

Parameters:
object - An object from getTopLevelWindows or from a previous call to getChildren.
dataInfo - Allows us to specify what type of data we want returned. This will be specific to the types of objects from which we extract data. For example, Tables might provide "Contents" or "Headers" or other different types of data. This dataInfo is usually provided as a String value.
Returns:
String[][] 2D array of extracted data. 0-length arrays if no data is available or the ability to extract data is not supported.

process

TestRecordData process(java.lang.Object object,
                       TestRecordData testRecordData)
Process the action provided in the testRecordData. An Agent may throw various types of Agent-specific Exceptions depending upon failure modes.

Parameters:
testRecordData - provides all the information needed by the Agent to perform the action.
Returns:
TestRecordData with necessary info, especially the modified statuscode.