com.mule.connectors.testdata.utils
Class XPathEvaluator

java.lang.Object
  extended by com.mule.connectors.testdata.utils.XPathEvaluator

public class XPathEvaluator
extends Object


Constructor Summary
XPathEvaluator(Document sourceDoc)
           
 
Method Summary
 NodeList evaluateOnDocAndGetNodeList(String expression)
           
 Node evaluateOnElementAndGetNode(Element elem, String expression)
           
 NodeList evaluateOnElementAndGetNodeList(Element elem, String expression)
           
 Element getFirstElementWithTag(Element parent, String tag)
          Searches from the @parent node and returns the first element with tag equals to @tag.
 Element getFirstElementWithTag(String tag)
          Searches the whole document and returns the first element with tag equals to @tag.
 boolean hasChildElement(Element parent, String childName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathEvaluator

public XPathEvaluator(Document sourceDoc)
Method Detail

evaluateOnDocAndGetNodeList

public NodeList evaluateOnDocAndGetNodeList(String expression)
                                     throws XPathExpressionException
Throws:
XPathExpressionException

evaluateOnElementAndGetNodeList

public NodeList evaluateOnElementAndGetNodeList(Element elem,
                                                String expression)
                                         throws XPathExpressionException
Throws:
XPathExpressionException

evaluateOnElementAndGetNode

public Node evaluateOnElementAndGetNode(Element elem,
                                        String expression)
                                 throws XPathExpressionException
Throws:
XPathExpressionException

hasChildElement

public boolean hasChildElement(Element parent,
                               String childName)

getFirstElementWithTag

public Element getFirstElementWithTag(String tag)
Searches the whole document and returns the first element with tag equals to @tag. If none is found, null is returned


getFirstElementWithTag

public Element getFirstElementWithTag(Element parent,
                                      String tag)
Searches from the @parent node and returns the first element with tag equals to @tag. If none is found, null is returned



Copyright © 2014. All rights reserved.