Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.websody.util
Class XPathGenerator  view XPathGenerator download XPathGenerator.java

java.lang.Object
  extended byorg.websody.util.XPathGenerator

public class XPathGenerator
extends java.lang.Object

Generates XPath expressions that uniquely identify a node.


Constructor Summary
XPathGenerator()
           
 
Method Summary
private static org.w3c.dom.Node getNextTypedNode(org.w3c.dom.Node node, short nodeType)
           
private static short getNodeType(org.w3c.dom.Node node)
           
static java.lang.String getPathToNode(org.w3c.dom.Node node)
          Generates an XPath expression that will return only the given node as its result.
private static org.w3c.dom.Node getPreviousTypedNode(org.w3c.dom.Node node, short nodeType)
           
private static java.lang.String getValue(org.w3c.dom.Node node, short nodeType)
           
private static java.util.Vector getVectorPathFromNode(org.w3c.dom.Node node)
           
private static java.lang.String getXPathFromVector(java.util.Vector path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathGenerator

public XPathGenerator()
Method Detail

getPreviousTypedNode

private static org.w3c.dom.Node getPreviousTypedNode(org.w3c.dom.Node node,
                                                     short nodeType)

getNextTypedNode

private static org.w3c.dom.Node getNextTypedNode(org.w3c.dom.Node node,
                                                 short nodeType)

getValue

private static java.lang.String getValue(org.w3c.dom.Node node,
                                         short nodeType)

getNodeType

private static short getNodeType(org.w3c.dom.Node node)

getXPathFromVector

private static java.lang.String getXPathFromVector(java.util.Vector path)

getVectorPathFromNode

private static java.util.Vector getVectorPathFromNode(org.w3c.dom.Node node)

getPathToNode

public static java.lang.String getPathToNode(org.w3c.dom.Node node)
                                      throws java.lang.IllegalArgumentException
Generates an XPath expression that will return only the given node as its result. This method only works for element, text, document and PI nodes.