|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.schmant.support.xml.xpath.XPathSupport
public final class XPathSupport
Utility class with static methods for XPath.
Method Summary | |
---|---|
static Node |
getNode(XPath xp,
Node n,
String expr)
Get the document Node matching the supplied XPath expression. |
static NodeList |
getNodeList(XPath xp,
Node n,
String expr)
Get the list of Node :s matching the supplied XPath expression. |
static Object |
getObject(XPath xp,
Node n,
String expr,
QName type)
Get the object that is returned when evaluating the supplied XPath expression. |
static String |
getString(XPath xp,
Node n,
String expr)
Get the text returned when evaluating the supplied XPath expression. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Object getObject(XPath xp, Node n, String expr, QName type) throws SchmantException
xp
- The XPath
object.n
- The Node
to evaluate the expression from.expr
- The XPath expression.type
- The type of object to return.
SchmantException
- If the XPath expression did not return any
value, or on other errors.public static Node getNode(XPath xp, Node n, String expr) throws SchmantException
Node
matching the supplied XPath expression.
xp
- The XPath
object.n
- The Node
to evaluate the expression from.expr
- The XPath expression.
Node
matching the expression.
SchmantException
- If no Node
matched the expression, or on
other evaluation errors.public static NodeList getNodeList(XPath xp, Node n, String expr) throws SchmantException
Node
:s matching the supplied XPath expression.
xp
- The XPath
object.n
- The Node
to evaluate the expression from.expr
- The XPath expression.
Node
:s matching the expression. If no nodes
match the expression, an empty list is returned.
SchmantException
- On evaluation errors.public static String getString(XPath xp, Node n, String expr) throws SchmantException
xp
- The XPath
object.n
- The Node
to evaluate the expression from.expr
- The XPath expression.
SchmantException
- On evaluation errors.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |