org.openeai.xml
Class XmlElementLocator


java.lang.Object

  |

  +--org.openeai.OpenEaiObject

        |

        +--org.openeai.xml.XmlElementLocator


public class XmlElementLocator
extends OpenEaiObject

An XmlElementLocator class. Contains helper methods to find elements within an Xml document.

Version:
3.0 beta2 - 28 January 2003
Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)

Field Summary
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
XmlElementLocator()
          Constructor
 
Method Summary
 org.jdom.Element getElementByAttributeNameValue(org.jdom.Element e, java.lang.String attrName, java.lang.String attrValue)
          Convenience method that searches for and returns an Element that has a child Attribute of "attrName" with a value of "attrValue".
 org.jdom.Element getElementByAttributeValue(org.jdom.Element e, java.lang.String attrValue)
          Convenience method that searches for and returns an Element that has any child Attributes with a value of "attrValue".
 org.jdom.Element getElementByName(org.jdom.Element e, java.lang.String name)
          Convenience method that searches for and returns an Element that has a child Element with a name that matches the name passed in.
 org.jdom.Element getElementByNameValue(org.jdom.Element e, java.lang.String name, java.lang.String value)
          Convenience method that searches for and returns an Element that has a child Element of "name" with a value of "value".
 org.jdom.Element getElementByValue(org.jdom.Element e, java.lang.String value)
          Convenience method that searches for and returns an Element that has a child Element with a value of "value".
 
Methods inherited from class org.openeai.OpenEaiObject
addLog4jProperty, getAppName, getDebug, getFromAddr, getLog4jProperties, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setAppName, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlElementLocator


public XmlElementLocator()
Constructor

Method Detail

getElementByAttributeNameValue


public final org.jdom.Element getElementByAttributeNameValue(org.jdom.Element e,
                                                             java.lang.String attrName,
                                                             java.lang.String attrValue)
Convenience method that searches for and returns an Element that has a child Attribute of "attrName" with a value of "attrValue". If no Elements are found, returns null.

The search is recursive meaning that it will "drill" down into all child Elements of the starting element passed in as well.

Returns:
Element the element that meets the criteria specified by the Attribute name and value passed in, null if no Elements are found

getElementByAttributeValue


public final org.jdom.Element getElementByAttributeValue(org.jdom.Element e,
                                                         java.lang.String attrValue)
Convenience method that searches for and returns an Element that has any child Attributes with a value of "attrValue". If no Elements are found, returns null.

The search is recursive meaning that it will "drill" down into all child Elements of the starting element passed in as well.

Returns:
Element the element that meets the criteria specified by the Attribute value passed in, null if no Elements are found

getElementByName


public final org.jdom.Element getElementByName(org.jdom.Element e,
                                               java.lang.String name)
Convenience method that searches for and returns an Element that has a child Element with a name that matches the name passed in. If no Elements are found, returns null.

The search is recursive meaning that it will "drill" down into all child Elements of the starting element passed in as well.

Returns:
Element the element that meets the criteria specified by the Element name passed in, null if no Elements are found

getElementByNameValue


public final org.jdom.Element getElementByNameValue(org.jdom.Element e,
                                                    java.lang.String name,
                                                    java.lang.String value)
Convenience method that searches for and returns an Element that has a child Element of "name" with a value of "value". If no Elements are found, returns null.

The search is recursive meaning that it will "drill" down into all child Elements of the starting element passed in as well.

Returns:
Element the element that meets the criteria specified by the Element name and value passed in, null if no Elements are found

getElementByValue


public final org.jdom.Element getElementByValue(org.jdom.Element e,
                                                java.lang.String value)
Convenience method that searches for and returns an Element that has a child Element with a value of "value". If no Elements are found, returns null.

The search is recursive meaning that it will "drill" down into all child Elements of the starting element passed in as well.

Returns:
Element the element that meets the criteria specified by the Element value passed in, null if no Elements are found


Copyright © 2002, OpenEAI Software Foundation