|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdom.contrib.helpers.XPathHelper
public class XPathHelper
Provides a set of utility methods to generate XPath expressions to select a given node in a (subtree of a) document.
Note: As this class has no knowledge of the document content, the generated XPath expression rely on the document structure. Hence any modification of the structure of the document may invalidate the generated XPaths.
Constructor Summary | |
---|---|
XPathHelper()
|
Method Summary | |
---|---|
static java.lang.String |
getPathString(org.jdom.Attribute to)
Returns the path to the specified Attribute from the document root as an XPath expression. |
static java.lang.String |
getPathString(org.jdom.Comment to)
Returns the path to the specified Comment from the document root as an XPath expression. |
static java.lang.String |
getPathString(org.jdom.Element to)
Returns the path to the specified Element from the document root as an XPath expression. |
static java.lang.String |
getPathString(java.lang.Object to)
Returns the path to the specified JDOM node from the document root as an XPath expression. |
static java.lang.String |
getPathString(java.lang.Object from,
org.jdom.Attribute to)
Returns the path from a given JDOM node to the specified Attribute as an XPath expression. |
static java.lang.String |
getPathString(java.lang.Object from,
org.jdom.Comment to)
Returns the path from a given JDOM node to the specified Comment as an XPath expression. |
static java.lang.String |
getPathString(java.lang.Object from,
org.jdom.Element to)
Returns the path from a given JDOM node to the specified Element as an XPath expression. |
static java.lang.String |
getPathString(java.lang.Object from,
java.lang.Object to)
Returns the path from a JDOM node to another JDOM node as an XPath expression. |
static java.lang.String |
getPathString(java.lang.Object from,
org.jdom.ProcessingInstruction to)
Returns the path from a given JDOM node to the specified ProcessingInstruction node as an XPath expression. |
static java.lang.String |
getPathString(java.lang.Object from,
org.jdom.Text to)
Returns the path from a given JDOM node to the specified Text node as an XPath expression. |
static java.lang.String |
getPathString(org.jdom.ProcessingInstruction to)
Returns the path to the specified ProcessingInstruction node from the document root as an XPath expression. |
static java.lang.String |
getPathString(org.jdom.Text to)
Returns the path to the specified Text node from the document root as an XPath expression. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XPathHelper()
Method Detail |
---|
public static java.lang.String getPathString(org.jdom.Element to) throws org.jdom.JDOMException
to
- the Element the generated path shall select.
org.jdom.JDOMException
- if the XPath generation failed.
java.lang.IllegalArgumentException
- if to
is
null
.public static java.lang.String getPathString(java.lang.Object from, org.jdom.Element to) throws org.jdom.JDOMException
from
- the Document or Element node at which the
the generated path shall be applied. Use
null
to specify the topmost
ancestor of the to
node.to
- the Element the generated path shall select.
org.jdom.JDOMException
- if the XPath generation failed.
java.lang.IllegalArgumentException
- if to
is
null
or from
is not
a Document
or a Element
node.public static java.lang.String getPathString(org.jdom.Attribute to) throws org.jdom.JDOMException
to
- the Attribute the generated path shall select.
org.jdom.JDOMException
- if the XPath generation failed.
java.lang.IllegalArgumentException
- if to
is
null
.public static java.lang.String getPathString(java.lang.Object from, org.jdom.Attribute to) throws org.jdom.JDOMException
from
- the Document or Element node at which the
the generated path shall be applied. Use
null
to specify the topmost
ancestor of the to
node.to
- the Attribute the generated path shall select.
org.jdom.JDOMException
- if the XPath generation failed.
java.lang.IllegalArgumentException
- if to
is
null
or from
is not
a Document
or a Element
node.public static java.lang.String getPathString(org.jdom.Text to) throws org.jdom.JDOMException
to
- the Text node the generated path shall select.
org.jdom.JDOMException
- if the XPath generation failed.
java.lang.IllegalArgumentException
- if to
is
null
.public static java.lang.String getPathString(java.lang.Object from, org.jdom.Text to) throws org.jdom.JDOMException
from
- the Document or Element node at which the
the generated path shall be applied. Use
null
to specify the topmost
ancestor of the to
node.to
- the Text node the generated path shall select.
org.jdom.JDOMException
- if the XPath generation failed.
java.lang.IllegalArgumentException
- if to
is
null
or from
is not
a Document
or a Element
node.public static java.lang.String getPathString(org.jdom.Comment to) throws org.jdom.JDOMException
to
- the Comment the generated path shall select.
org.jdom.JDOMException
- if the XPath generation failed.
java.lang.IllegalArgumentException
- if to
is
null
.public static java.lang.String getPathString(java.lang.Object from, org.jdom.Comment to) throws org.jdom.JDOMException
from
- the Document or Element node at which the
the generated path shall be applied. Use
null
to specify the topmost
ancestor of the to
node.to
- the Comment the generated path shall select.
org.jdom.JDOMException
- if the XPath generation failed.
java.lang.IllegalArgumentException
- if to
is
null
or from
is not
a Document
or a Element
node.public static java.lang.String getPathString(org.jdom.ProcessingInstruction to) throws org.jdom.JDOMException
to
- the ProcessingInstruction node the generated path
shall select.
org.jdom.JDOMException
- if the XPath generation failed.
java.lang.IllegalArgumentException
- if to
is
null
.public static java.lang.String getPathString(java.lang.Object from, org.jdom.ProcessingInstruction to) throws org.jdom.JDOMException
from
- the Document or Element node at which the
the generated path shall be applied. Use
null
to specify the topmost
ancestor of the to
node.to
- the ProcessingInstruction node the generated
path shall select.
org.jdom.JDOMException
- if the XPath generation failed.
java.lang.IllegalArgumentException
- if to
is
null
or from
is not
a Document
or a Element
node.public static java.lang.String getPathString(java.lang.Object to) throws org.jdom.JDOMException
to
- the JDOM node the generated path shall select.
org.jdom.JDOMException
- if the XPath generation failed.
java.lang.IllegalArgumentException
- if to
is
null
or is not a JDOM node selectable
by XPath expressions (Element, Attribute, Text,
Comment, ProcessingInstruction).public static java.lang.String getPathString(java.lang.Object from, java.lang.Object to) throws org.jdom.JDOMException
from
- the Document or Element node at which the
the generated path shall be applied. Use
null
to specify the topmost
ancestor of the to
node.to
- the JDOM node the generated path shall select.
org.jdom.JDOMException
- if the XPath generation failed.
java.lang.IllegalArgumentException
- if from
is not
a Document
or a Element
node or
to
is null
or is not a JDOM
node selectable by XPath expressions (Element,
Attribute, Text, Comment, ProcessingInstruction).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |