|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GuModel<N>
The model provides the tree API.
End users will normally consume, rather than implement, this interface.
Method Summary | |
---|---|
int |
compare(N one,
N two)
Determines the relative document order of two nodes. |
java.lang.Iterable<N> |
getAncestorAxis(N node)
Returns the nodes along the ancestor axis using the specified node as the origin. |
java.lang.Iterable<N> |
getAncestorOrSelfAxis(N node)
Returns the nodes along the ancestor-or-self axis using the specified node as the origin. |
N |
getAttribute(N node,
java.lang.String namespaceURI,
java.lang.String localName)
Returns the attribute node with the specified expanded-QName. |
java.lang.Iterable<N> |
getAttributeAxis(N node,
boolean inherit)
Returns the nodes along the attribute axis using the specified node as the origin. |
java.lang.Iterable<javax.xml.namespace.QName> |
getAttributeNames(N node,
boolean orderCanonical)
Returns the set of attribute names for the node. |
java.lang.Iterable<N> |
getAttributes(N node)
Returns the attribute nodes that are local to the specified element. |
java.lang.Iterable<N> |
getAttributesInScope(N node)
Returns the attribute nodes that are local to the specified element as well as those in the reserved XML namespace that are inherited. |
java.lang.Iterable<N> |
getChildAxis(N node)
Returns the nodes along the child axis using the specified node as the origin. |
java.lang.Iterable<N> |
getChildElements(N node)
Returns all the child element along the child axis. |
java.lang.Iterable<N> |
getChildElementsByName(N node,
java.lang.String namespaceURI,
java.lang.String localName)
Returns all the child element along the child axis whose names match the arguments supplied. |
java.lang.Iterable<N> |
getDescendantAxis(N node)
Returns the nodes along the descendant axis using the specified node as the origin. |
java.lang.Iterable<N> |
getDescendantOrSelfAxis(N node)
Returns the nodes along the descendant-or-self axis using the specified node as the origin. |
N |
getFirstChild(N node)
Returns the first child node of the node provided. |
N |
getFirstChildElement(N node)
Returns the first element along the child axis. |
N |
getFirstChildElementByName(N node,
java.lang.String namespaceURI,
java.lang.String localName)
Returns the first child element along the child axis whose name matches the arguments supplied. |
java.lang.Iterable<N> |
getFollowingAxis(N node)
Returns the nodes along the following axis using the specified node as the origin. |
java.lang.Iterable<N> |
getFollowingSiblingAxis(N node)
Returns the nodes along the following-sibling axis using the specified node as the origin. |
N |
getLastChild(N node)
Returns the last child node of the node provided. |
int |
getLineNumber(N node)
Returns the line number, or -1 if none is available. |
java.lang.String |
getLocalName(N node)
Returns the local-name part of the dm:node-name. |
java.lang.Iterable<N> |
getNamespaceAxis(N node,
boolean inherit)
Returns the nodes along the namespace axis using the specified node as the origin. |
java.lang.Iterable<java.lang.String> |
getNamespaceNames(N node,
boolean orderCanonical)
Returns the set of namespace names (prefixes) for a given node. |
java.lang.Iterable<N> |
getNamespaces(N node)
Returns the namespace nodes that are local to the specified element. |
java.lang.Iterable<N> |
getNamespacesInScope(N node)
Returns the namespace nodes that are local to the specified element as well as those that are inherited. |
java.lang.String |
getNamespaceURI(N node)
Returns the namespace-uri part of the dm:node-name. |
java.lang.String |
getNamespaceURI(N node,
java.lang.String prefix)
|
java.lang.String |
getNamespaceURIInScope(N node,
java.lang.String prefix)
Returns the namespace-uri associated with the specified prefix using a node as a starting context. |
N |
getNextSibling(N node)
Returns the next sibling node of the node provided. |
N |
getNextSiblingElement(N node)
Returns the next element along the child axis. |
N |
getNextSiblingElementByName(N node,
java.lang.String namespaceURI,
java.lang.String localName)
Returns the next element along the following-sibling axis whose name matches the arguments supplied. |
NodeKind |
getNodeKind(N node)
Returns the node-kind of the node as an enumeration in NodeKind . |
N |
getParent(N node)
Returns the parent node of the node provided. |
java.lang.Iterable<N> |
getPrecedingAxis(N node)
Returns the nodes along the preceding axis using the specified node as the origin. |
java.lang.Iterable<N> |
getPrecedingSiblingAxis(N node)
Returns the nodes along the preceding-sibling axis using the specified node as the origin. |
java.lang.String |
getPrefix(N node)
Returns the prefix part of the node name. |
N |
getPreviousSibling(N node)
Returns the previous sibling node of the node provided. |
N |
getRoot(N node)
Returns the identity of the top-most node along the ancestor-or-self axis from this node. |
java.lang.String |
getStringValue(N node)
Returns the dm:string-value property of the node. |
boolean |
hasAttributes(N node)
Determines whether there are nodes on the attribute axis for this node. |
boolean |
hasChildren(N node)
Determines whether there are nodes on the child axis for this node. |
boolean |
hasNamespaces(N node)
Determines whether there are prefix-to-namespace mappings for this node. |
boolean |
hasNextSibling(N node)
Determines whether the node has a following sibling. |
boolean |
hasParent(N node)
Determines whether there are nodes on the parent axis for this node. |
boolean |
hasPreviousSibling(N node)
Determines whether the node has a preceding sibling. |
boolean |
isSameNode(N one,
N two)
Determines whether the two nodes represent the same nodes based upon identity. |
boolean |
matches(N node,
NodeKind nodeKind,
java.lang.String namespaceURI,
java.lang.String localName)
Deterimines whether the specified node matches the arguments. |
N[] |
nodeArray(int size)
Allocates an empty array of nodes. |
void |
write(N node,
GuContentHandler writer)
Support for streaming a node to a GuContentHandler . |
Methods inherited from interface java.util.Comparator |
---|
equals |
Method Detail |
---|
int compare(N one, N two)
compare
in interface java.util.Comparator<N>
one
- The first node used in the comparison.two
- The second node in the comparison.N getAttribute(N node, java.lang.String namespaceURI, java.lang.String localName)
getAttribute
in interface Model<N,java.lang.String,javax.xml.namespace.QName>
node
- The node that is the parent of the attribute node.namespaceURI
- The namespace-uri part of the attribute name.localName
- The local-name part of the attribute name.java.lang.Iterable<javax.xml.namespace.QName> getAttributeNames(N node, boolean orderCanonical)
This method does not inherit attribute names in the reserved XML namespace.
getAttributeNames
in interface Model<N,java.lang.String,javax.xml.namespace.QName>
node
- The node for which the attribute names are required.orderCanonical
- Determines whether the names will be returned in canonical order (lexicographically by namespace
URI,local name).java.lang.Iterable<N> getAttributes(N node)
node
- The origin node.java.lang.Iterable<N> getAttributesInScope(N node)
node
- The origin node.N getFirstChild(N node)
node
- The node for which the first child node is required.N getLastChild(N node)
node
- The node for which the last child node is required.java.lang.String getLocalName(N node)
null
.
getLocalName
in interface Model<N,java.lang.String,javax.xml.namespace.QName>
node
- The node for which the node local-name is required.java.lang.Iterable<java.lang.String> getNamespaceNames(N node, boolean orderCanonical)
orderCanonical
- Determines whether the names will be returned in canonical order (lexicographically by local name).java.lang.Iterable<N> getNamespaces(N node)
node
- The origin node.java.lang.Iterable<N> getNamespacesInScope(N node)
node
- The origin node.java.lang.String getNamespaceURI(N node)
null
.
getNamespaceURI
in interface Model<N,java.lang.String,javax.xml.namespace.QName>
node
- The node for which the node namespace-uri is required.java.lang.String getNamespaceURI(N node, java.lang.String prefix)
java.lang.String getNamespaceURIInScope(N node, java.lang.String prefix)
N getNextSibling(N node)
node
- The node for which the next sibling node is required.NodeKind getNodeKind(N node)
NodeKind
.
Applies to all node kinds and never returns null
.
getNodeKind
in interface Model<N,java.lang.String,javax.xml.namespace.QName>
node
- The node for which the node-kind is required.N getParent(N node)
null
for top-most or orphaned nodes.
getParent
in interface Model<N,java.lang.String,javax.xml.namespace.QName>
node
- The node for which the parent is required.java.lang.String getPrefix(N node)
null
. Even in cases where there is
no prefix hint, the value is the zero-length string.
node
- The node for which the prefix-hint is required.N getPreviousSibling(N node)
node
- The node for which the previous sibling node is required.java.lang.String getStringValue(N node)
getStringValue
in interface Model<N,java.lang.String,javax.xml.namespace.QName>
node
- The node for which the dm:string-value is required.boolean hasAttributes(N node)
node
- The node under consideration.boolean hasChildren(N node)
node
- The node under consideration.boolean hasNamespaces(N node)
node
- The node under consideration.boolean hasNextSibling(N node)
node
- The node under consideration.boolean hasParent(N node)
node
- The node under consideration.boolean hasPreviousSibling(N node)
node
- The node under consideration.boolean isSameNode(N one, N two)
one
- The first node used in the comparison.two
- The second node used in the comparison.boolean matches(N node, NodeKind nodeKind, java.lang.String namespaceURI, java.lang.String localName)
node
- The XML node.nodeKind
- The node kind to match.namespaceURI
- The namespace-uri to match.localName
- The local-name to match.N[] nodeArray(int size)
size
- The size of the array of nodes.java.lang.Iterable<N> getAncestorAxis(N node)
getAncestorAxis
in interface Model<N,java.lang.String,javax.xml.namespace.QName>
node
- The origin node.java.lang.Iterable<N> getAncestorOrSelfAxis(N node)
getAncestorOrSelfAxis
in interface Model<N,java.lang.String,javax.xml.namespace.QName>
node
- The origin node.java.lang.Iterable<N> getAttributeAxis(N node, boolean inherit)
node
- The origin node.inherit
- Determines whether attribultes in the XML namespace will be inherited. The standard value for this
parameter is false
.java.lang.Iterable<N> getChildAxis(N node)
getChildAxis
in interface Model<N,java.lang.String,javax.xml.namespace.QName>
node
- The origin node.java.lang.Iterable<N> getChildElements(N node)
node
- The parent node that owns the child axis.java.lang.Iterable<N> getChildElementsByName(N node, java.lang.String namespaceURI, java.lang.String localName)
node
- The parent node that owns the child axis.namespaceURI
- The namespace-uri to be matched.localName
- The local-name to be matched.java.lang.Iterable<N> getDescendantAxis(N node)
node
- The origin node.java.lang.Iterable<N> getDescendantOrSelfAxis(N node)
node
- The origin node.N getFirstChildElement(N node)
node
- The parent node that owns the child axis.N getFirstChildElementByName(N node, java.lang.String namespaceURI, java.lang.String localName)
node
- The parent node that owns the child axis.namespaceURI
- The namespace-uri to be matched.localName
- The local-name to be matched.java.lang.Iterable<N> getFollowingAxis(N node)
node
- The origin node.java.lang.Iterable<N> getFollowingSiblingAxis(N node)
node
- The origin node.int getLineNumber(N node)
-1
if none is available.
java.lang.Iterable<N> getNamespaceAxis(N node, boolean inherit)
The namespace axis contains the namespace nodes of the context node; the axis will be empty unless the context node is an element.
node
- The origin node.inherit
- Determines whether in-scope prefix mappings will be included in the result. The standard setting for
this parameter is true
.N getNextSiblingElement(N node)
node
- The node for which the next sibling node is required.N getNextSiblingElementByName(N node, java.lang.String namespaceURI, java.lang.String localName)
node
- The node for which the next sibling node is required.namespaceURI
- The namespace-uri to be matched.localName
- The local-name to be matched.java.lang.Iterable<N> getPrecedingAxis(N node)
node
- The origin node.java.lang.Iterable<N> getPrecedingSiblingAxis(N node)
node
- The origin node.N getRoot(N node)
node
- The node from which to begin the search for the top-most node.void write(N node, GuContentHandler writer) throws java.io.IOException
GuContentHandler
.
node
- The node to be streamed.writer
- The handler for the events generated.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |