|
||||||||||
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
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
previous path element. |
protected XPathExpression |
m_xPath
Xpath expression. |
Constructor Summary | |
---|---|
protected |
XMLPath(XMLPath previous)
|
protected |
XMLPath(XMLPathCtx ctx)
|
Method Summary | |
---|---|
XMLPath.NodeSetXMLPath |
all(String xpath)
Method all, expects a xpath query resulting in a NodeList. |
XMLPath.BooleanXMLPath |
bool(String xpath)
Method bool, expects a xpath query resulting in a Boolean. |
protected XMLPath |
compile(String xpath)
Method compiles an xpath. |
protected Object |
eval()
Method evals the xpath. |
protected abstract QName |
getReturnType()
Method gets the returnType of an evaluation. |
XMLPath.NodeXMLPath |
node(String xpath)
Method node, expects a xpath query resulting in a node. |
XMLPath.NumberXMLPath |
number(String xpath)
Method number, expects a xpath query resulting in a number. |
XMLPath.StringXMLPath |
text(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 XPathExpression m_xPath
Constructor Detail |
---|
protected XMLPath(XMLPathCtx ctx)
protected XMLPath(XMLPath previous)
Method Detail |
---|
protected Object eval()
protected abstract QName getReturnType()
protected XMLPath compile(String xpath)
xpath
- the xpath.
public XMLPath.NodeXMLPath node(String xpath)
xpath
- the xpath.
public XMLPath.NodeSetXMLPath all(String xpath)
xpath
- the xpath.
public XMLPath.NumberXMLPath number(String xpath)
xpath
- the xpath.
public XMLPath.StringXMLPath text(String xpath)
xpath
- the xpath.
public XMLPath.BooleanXMLPath bool(String xpath)
xpath
- the xpath.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |