edu.washington.cs.supple.customization.scope
Class XMLPatternSearch

java.lang.Object
  extended byedu.washington.cs.supple.customization.scope.XMLPatternSearch

public class XMLPatternSearch
extends java.lang.Object

Creates XML representations of UiObject tree, application tree, and device tree. These are used to efficiently search for elements that satisfy scope conditions by using XPath.

Author:
raphael

Constructor Summary
XMLPatternSearch()
           
 
Method Summary
static javax.xml.transform.dom.DOMSource buildApplicationTree(java.lang.String application)
          Builds an XML tree that contains information about the Supple application.
static javax.xml.transform.dom.DOMSource buildDeviceTree(DeviceProperties device)
          Builds an XML tree that contains information about the device.
static javax.xml.transform.dom.DOMSource buildObjectTree(UiObject object)
          Builds an XML tree based on the current UiObject tree.
static boolean findApplication(javax.xml.transform.dom.DOMSource src, java.lang.String applicationXPath)
           
static boolean findDevice(javax.xml.transform.dom.DOMSource src, java.lang.String deviceXPath)
           
static java.util.List findObjects(javax.xml.transform.dom.DOMSource src, java.lang.String xPathExpr)
           
 UiObject getAbsoluteUiObject(UiObject root, java.lang.Object path)
           
static java.lang.String getClassName(java.lang.Class c)
           
static void writeXMLToFile(javax.xml.transform.dom.DOMSource s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLPatternSearch

public XMLPatternSearch()
Method Detail

buildDeviceTree

public static javax.xml.transform.dom.DOMSource buildDeviceTree(DeviceProperties device)
Builds an XML tree that contains information about the device. At the moment only one attribute ("name") is added, but in later versions we could include information such as screen size, input types, so that these properties can be used to define the scope.


buildApplicationTree

public static javax.xml.transform.dom.DOMSource buildApplicationTree(java.lang.String application)
Builds an XML tree that contains information about the Supple application. At the moment only one attribute ("name") is added, but in later versions we could include information such as accesses network, office application, so that these properties can be used to define the scope.


buildObjectTree

public static javax.xml.transform.dom.DOMSource buildObjectTree(UiObject object)
Builds an XML tree based on the current UiObject tree. Each node contains information about name, type, and a unique id.


getClassName

public static java.lang.String getClassName(java.lang.Class c)

writeXMLToFile

public static void writeXMLToFile(javax.xml.transform.dom.DOMSource s)

findDevice

public static boolean findDevice(javax.xml.transform.dom.DOMSource src,
                                 java.lang.String deviceXPath)
                          throws java.lang.Exception
Throws:
java.lang.Exception

findApplication

public static boolean findApplication(javax.xml.transform.dom.DOMSource src,
                                      java.lang.String applicationXPath)
                               throws java.lang.Exception
Throws:
java.lang.Exception

findObjects

public static java.util.List findObjects(javax.xml.transform.dom.DOMSource src,
                                         java.lang.String xPathExpr)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

getAbsoluteUiObject

public UiObject getAbsoluteUiObject(UiObject root,
                                    java.lang.Object path)