|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.c24.io.api.data.XPathStatement
public class XPathStatement
An immutable XPath statement which may or may not be namespace aware.
This class wraps the XPath expression and an optional set of namespace mappings that are used by it. If for example the XPath statement read:
//c24:party/c24:namethen a namespace mapping should exist for the "c24" prefix.
Constructor Summary | |
---|---|
XPathStatement(String xpath)
Creates a new non-namespace aware XPath statement. |
|
XPathStatement(String xpath,
boolean ignoreDocumentNode,
boolean namespaceAware)
Creates a new, possibly namespace aware, instance with the specified XPath statement. |
|
XPathStatement(String xpath,
boolean ignoreDocumentNode,
NamespaceMapping[] namespaces)
Creates a new instances with the specified XPath statement and namespaces If namespaces == null || namespaces.length == 0 then this constructor will create a non-namespace aware
instance. |
Method Summary | |
---|---|
NamespaceMapping |
getNamespace(int index)
Returns the namespace mapping at index . |
int |
getNamespaceCount()
Returns the number of namespace mappings present. |
NamespaceMapping[] |
getNamespaces()
Returns a copy of the array of namespaces held by this object. |
String |
getXPath()
Returns the XPath statement. |
boolean |
isIgnoreDocumentNode()
Whether the document node will be skipped whilst traversing the descendant axis. |
boolean |
isNamespaceAware()
Returns whether this statement is namespace aware. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XPathStatement(String xpath)
The resulting statement will skip the document node whilst traversing the descendant axis.
xpath
- The XPath statement - which should NOT include namespace prefixes.
IllegalArgumentException
- If no XPAth statement was specified.public XPathStatement(String xpath, boolean ignoreDocumentNode, boolean namespaceAware)
If namespaceAware == true
then since no namespace mappings are being specified the XPath statement
should only use components from the default (i.e. no prefix) namespace.
xpath
- The XPath statement - which should NOT include namespace prefixes.ignoreDocumentNode
- Whether to skip the document node whilst traversing the descendant axis.namespaceAware
- Whether to take account of namespaces.
IllegalArgumentException
- If no XPAth statement was specified.public XPathStatement(String xpath, boolean ignoreDocumentNode, NamespaceMapping[] namespaces)
If namespaces == null || namespaces.length == 0
then this constructor will create a non-namespace aware
instance.
xpath
- The XPath statement - which can include namespace prefixes.ignoreDocumentNode
- Whether to skip the document node whilst traversing the descendant axis.namespaces
- An optional array of namespace mappings used by the XPath statement.
IllegalArgumentException
- If no XPAth statement was specified.Method Detail |
---|
public String getXPath()
public boolean isIgnoreDocumentNode()
If this property is set to true
then the XPath statement should attempt to descend directly from below
the document node and therefore NOT include it's name. This is often required since the name of the document node
(i.e. the root defining element declaration) is not fixed at the point at which the rule is defined on the type.
public boolean isNamespaceAware()
public NamespaceMapping[] getNamespaces()
public int getNamespaceCount()
public NamespaceMapping getNamespace(int index)
index
.
index
- The index of the namespace mapping to return
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |