|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.n52.security.common.xml.XMLPath
public abstract class XMLPath
Class XMLPath represents an XPath and it's evaluation.
You create a "source" XMLPath by using theXMLPathCtx.findIn(org.w3c.dom.Document)
methods.
From there you can use the
methods to build a whole xpath.
After creation of an whole xpath you can call the get() method
of each concrete XMLPath instance, to get the result of the query.
Sample (finds a root node of a document):
XMLPathCtx ctx = XMLPathCtx.createNew()
.addNamespace("t", "http://tempuri.org/test");
Node result = ctx.findIn(document).node("/*").get();
Nested Class Summary | |
---|---|
static class |
XMLPath.BooleanXMLPath
Class BooleanXMLPath, represents xpath queries resulting in boolean values. |
static class |
XMLPath.NodeSetXMLPath
Class NodeSetXMLPath, represents xpaths resulting in NodeLists. |
static class |
XMLPath.NodeXMLPath
Class NodeXMLPath, represents xpaths resulting in nodes. |
static class |
XMLPath.NumberXMLPath
Class NumberXMLPath, represents xpath queries resulting in number values. |
static class |
XMLPath.SourceXMLPath
Class SourceXMLPath, represents the xpath root/or source of evaluation. |
static class |
XMLPath.StringXMLPath
Class StringXMLPath, represents xpaths queries resulting in string values. |
Field Summary | |
---|---|
protected XMLPathCtx |
m_ctx
|
protected XMLPath |
m_previous
|
protected javax.xml.xpath.XPathExpression |
m_xPath
|
Constructor Summary | |
---|---|
protected |
XMLPath(XMLPath previous)
Constructor creates a new instance. |
protected |
XMLPath(XMLPathCtx ctx)
Constructor creates a new instance. |
Method Summary | |
---|---|
XMLPath.NodeSetXMLPath |
all(java.lang.String xpath)
Method all, expects a xpath query resulting in a NodeList. |
XMLPath.BooleanXMLPath |
bool(java.lang.String xpath)
Method bool, expects a xpath query resulting in a Boolean. |
protected XMLPath |
compile(java.lang.String xpath)
Method compiles an xpath. |
protected java.lang.Object |
eval()
Method evals the xpath. |
protected abstract javax.xml.namespace.QName |
getReturnType()
Method gets the returnType of an evaluation. |
XMLPath.NodeXMLPath |
node(java.lang.String xpath)
Method node, expects a xpath query resulting in a node. |
XMLPath.NumberXMLPath |
number(java.lang.String xpath)
Method number, expects a xpath query resulting in a number. |
XMLPath.StringXMLPath |
text(java.lang.String xpath)
Method text, expects a xpath query resulting in a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected XMLPathCtx m_ctx
protected XMLPath m_previous
protected javax.xml.xpath.XPathExpression m_xPath
Constructor Detail |
---|
protected XMLPath(XMLPathCtx ctx)
ctx
- the ctx.protected XMLPath(XMLPath previous)
previous
- the previous.Method Detail |
---|
protected java.lang.Object eval()
protected abstract javax.xml.namespace.QName getReturnType()
protected XMLPath compile(java.lang.String xpath)
xpath
- the xpath.
public XMLPath.NodeXMLPath node(java.lang.String xpath)
xpath
- the xpath.
public XMLPath.NodeSetXMLPath all(java.lang.String xpath)
xpath
- the xpath.
public XMLPath.NumberXMLPath number(java.lang.String xpath)
xpath
- the xpath.
public XMLPath.StringXMLPath text(java.lang.String xpath)
xpath
- the xpath.
public XMLPath.BooleanXMLPath bool(java.lang.String xpath)
xpath
- the xpath.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |