org.safs
Class ApplicationMap

java.lang.Object
  extended by org.safs.STAFRequester
      extended by org.safs.ApplicationMap
Direct Known Subclasses:
RApplicationMap, SApplicationMap

public class ApplicationMap
extends STAFRequester

The Application Map (App Map) provides storage for Objects referencing the Application being tested. These may be actual application objects, or object proxies. This is dependent upon the implementation of the tools actually used for testing.

Each App Map represents one of any number of separate storage maps used for testing the application. Each App Map is known by its mapname which is retrievable with getMapName(). The name of the App Map is expected to match a corresponding App Map opened and handled by the SAFSMAPS service in STAF.

A Valid STAFHelper object must have been provided by a subclass implementation or via a direct call to setSTAFHelper prior to using an instance of this class.

Since:
JUN 26, 2003

Field Summary
protected  java.lang.String mapname
          The name of this AppMap.
 
Fields inherited from class org.safs.STAFRequester
staf
 
Constructor Summary
ApplicationMap(java.lang.String mapname)
          Subclasses should call this constructor or insure mapname gets set.
 
Method Summary
 void clearMap()
           
static java.lang.String extractTaggedGUIID(java.lang.String recognition)
          Extract the recognition string portion of a GUIID "tagged" by SAFSMAPS.
 java.lang.String getChildGUIID(java.lang.String parentName, java.lang.String childName)
          Retrieves the stored recognition string for the parent's child.
 java.lang.String getChildGUIID(java.lang.String parentName, java.lang.String childName, boolean isDynamic)
          Retrieves the stored recognition string for the parent's child.
 java.lang.Object getChildObject(java.lang.String parentName, java.lang.String childName)
          Retrieves the object stored for the given parent's child.
 java.lang.String getMapName()
           
 java.lang.String getParentGUIID(java.lang.String parentName)
          Retrieves the stored recognition string for the parent.
 java.lang.String getParentGUIID(java.lang.String parentName, boolean isDynamic)
          Retrieves the stored recognition string for the parent.
 java.lang.Object getParentObject(java.lang.String parentName)
          Retrieves the actual parent Object for the given parentName.
static boolean isGUIIDDynamic(java.lang.String recognition)
          Was the recognition string tagged by SAFSMAPS with ISDYNAMIC? SAFSMAPS will now tag recognition strings with ISDYNAMIC if it is requested to do so by the caller:
 void setChildObject(java.lang.String parentName, java.lang.String childName, java.lang.Object child)
          Stores the actual child Object for the named parent/child.
 void setParentObject(java.lang.String parentName, java.lang.Object parent)
          Stores the actual parent Object for the given parentName.
 
Methods inherited from class org.safs.STAFRequester
getSTAFHelper, setSTAFHelper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapname

protected java.lang.String mapname
The name of this AppMap. Must be identical to name used by SAFSMAPS service.

Constructor Detail

ApplicationMap

public ApplicationMap(java.lang.String mapname)
Subclasses should call this constructor or insure mapname gets set.

Parameters:
mapname - the name given to this AppMap. This should be identical to the name of an AppMap handled by the SAFSMAPS service.
Method Detail

clearMap

public void clearMap()

getMapName

public java.lang.String getMapName()
Returns:
String the stored name of this AppMap

getChildGUIID

public java.lang.String getChildGUIID(java.lang.String parentName,
                                      java.lang.String childName)
Retrieves the stored recognition string for the parent's child. Uses the SAFSMAPS service via STAF.

A Valid STAFHelper object must have been provided by a subclass implementation or via a direct call to setSTAFHelper prior to this call.

Parameters:
parentName - the name of the parent object or section in the AppMap.

childName - the name of the parent's child to retrieve.

Returns:
String recognition string or null if not found or an error occurs.

getParentGUIID

public java.lang.String getParentGUIID(java.lang.String parentName)
Retrieves the stored recognition string for the parent. Uses the SAFSMAPS service via STAF.

Parameters:
parentName - the name of the parent object as stored.

Returns:
String recognition string or null if not found or an error occurs.

getChildGUIID

public java.lang.String getChildGUIID(java.lang.String parentName,
                                      java.lang.String childName,
                                      boolean isDynamic)
Retrieves the stored recognition string for the parent's child. Uses the SAFSMAPS service via STAF.

A Valid STAFHelper object must have been provided by a subclass implementation or via a direct call to setSTAFHelper prior to this call.

Parameters:
parentName - the name of the parent object or section in the AppMap.

childName - the name of the parent's child to retrieve.

isDynamic - determines whether recognition string should be checked to see if its dynamic

Returns:
String recognition string or null if not found or an error occurs.

getParentGUIID

public java.lang.String getParentGUIID(java.lang.String parentName,
                                       boolean isDynamic)
Retrieves the stored recognition string for the parent. Uses the SAFSMAPS service via STAF.

Parameters:
parentName - the name of the parent object as stored.

isDynamic - determines whether recognition string should be checked to see if its dynamic

Returns:
String recognition string or null if not found or an error occurs.

isGUIIDDynamic

public static boolean isGUIIDDynamic(java.lang.String recognition)
Was the recognition string tagged by SAFSMAPS with ISDYNAMIC? SAFSMAPS will now tag recognition strings with ISDYNAMIC if it is requested to do so by the caller:

ISDYNAMIC;RECOGNITION=<GUIID recognition>

The routine will also return true if the recognition string is "CurrentWindow".

Parameters:
recognition - -- the non-null, potentially tagged recognition string from getGUIID calls.
Returns:
true if ";Recognition" and "ISDYNAMIC" is prefixed in the string of if the recognition string is "CurrentWindow"
See Also:
SAFSAppMapService

extractTaggedGUIID

public static java.lang.String extractTaggedGUIID(java.lang.String recognition)
Extract the recognition string portion of a GUIID "tagged" by SAFSMAPS. SAFSMAPS will now tag recognition strings with flags like "ISDYNAMIC" if it is requested to do so by the caller. When tagged, the recognition portion of the string appears as below:

<tags>;Recognition=<GUIID recognition>

If the item is not "tagged" then it will be returned unmodified.

Parameters:
recognition - -- the non-null, potentially tagged recognition string from getGUIID calls.
Returns:
the recognition portion of the string if tagged, or the unmodified input string if not.
See Also:
SAFSAppMapService

setChildObject

public void setChildObject(java.lang.String parentName,
                           java.lang.String childName,
                           java.lang.Object child)
Stores the actual child Object for the named parent/child. This object will be implementation specific for different tool-dependent subclasses. For example, this will contain a TestObject reference for certain Rational implementations.

Parameters:
parentName - the name of the parent as stored in the AppMap.

childName - the name of the parent's child.

child - the actual child object.

getChildObject

public java.lang.Object getChildObject(java.lang.String parentName,
                                       java.lang.String childName)
Retrieves the object stored for the given parent's child. This object will be implementation specific for different tool-dependent subclasses. For example, this will contain a TestObject reference for certain Rational implementations. The returned object will need to be cast to the appropriate type by the caller.

Parameters:
parentName - the name of the parent as stored in the AppMap.

childName - the name of the parent's child.

Returns:
Object the object if found, or null. The returned object will need to be cast to the appropriate type by the caller.

getParentObject

public java.lang.Object getParentObject(java.lang.String parentName)
Retrieves the actual parent Object for the given parentName. This object will be implementation specific for different tool-dependent subclasses. For example, this will contain a TestObject reference for certain Rational implementations. The returned object will need to be cast to the appropriate type by the caller.

Parameters:
parentName - the name of the parent object stored in the AppMap.

Returns:
Object the parent object if found, or null. The returned object will need to be cast to the appropriate type by the caller.

setParentObject

public void setParentObject(java.lang.String parentName,
                            java.lang.Object parent)
Stores the actual parent Object for the given parentName. This object will be implementation specific for different tool-dependent subclasses. For example, this will contain a TestObject reference for certain Rational implementations.

Parameters:
parentName - the name of the parent object to store in the AppMap.

parent - the actual parent object.