Package net.sf.saxon.tree.wrapper
Class RebasedNode
java.lang.Object
net.sf.saxon.tree.wrapper.AbstractVirtualNode
net.sf.saxon.tree.wrapper.RebasedNode
- All Implemented Interfaces:
Source,SourceLocator,ActiveSource,GNode,GroundedValue,Item,NodeInfo,Sequence,Location,VirtualNode,WrappingFunction,Locator
A RebasedNode is a view of a node, in a virtual tree that maps the base URI and/or
system ID to new values
-
Field Summary
Fields inherited from class net.sf.saxon.tree.wrapper.AbstractVirtualNode
docWrapper, node, parent -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedRebasedNode(NodeInfo node, RebasedNode parent) This constructor is protected: nodes should be created using the makeWrapper factory method -
Method Summary
Modifier and TypeMethodDescriptionintcompareOrder(GNode other) Determine the relative position of this node and another node, in document order.booleanDetermine whether this is the same node as another node.Get the Base URI for the node, that is, the URI used for resolving a relative URI contained in the node.Get the NodeInfo object representing the parent of this nodeGet the System ID for the node.inthashCode()The hashCode() method obeys the contract for hashCode(): that is, if two objects are equal (represent the same node) then they must have the same hashCode()iterateAncestorAxis(NodePredicate predicate) Get an iterator over the ancestor axis, starting at this node; the nodes will be in reverse document order.iterateAncestorOrSelfAxis(NodePredicate predicate) Get an iterator over the ancestor-or-self axis, starting at this node; the nodes will be in reverse document order.iterateAttributeAxis(NodePredicate predicate) Get an iterator over the attribute axis, starting at this node; the nodes will be in document order.iterateChildAxis(NodePredicate predicate) Get an iterator over the child axis, starting at this node; the nodes will be in document order.iterateDescendantAxis(NodePredicate predicate) Get an iterator over the descendant axis, starting at this node; the nodes will be in document order.iterateDescendantOrSelfAxis(NodePredicate predicate) Get an iterator over the descendant-or-self axis, starting at this node; the nodes will be in document order.iterateFollowingAxis(NodePredicate predicate) Get an iterator over the following axis, starting at this node; the nodes will be in document order.iterateFollowingOrSelfAxis(NodePredicate predicate) Get an iterator over the following-or-self axis, starting at this node; the nodes will be in document order.iterateFollowingSiblingAxis(NodePredicate predicate) Get an iterator over the following-sibling axis, starting at this node; the nodes will be in document order.iterateFollowingSiblingOrSelfAxis(NodePredicate predicate) Get an iterator over the following-sibling-or-self axis, starting at this node; the nodes will be in document order.iterateNamespaceAxis(NodePredicate predicate) Get an iterator over the namespace axis, starting at this node; the nodes will be in reverse document order.iterateParentAxis(NodePredicate predicate) Get an iterator over the parent axis, starting at this node; returns zero or one nodesiteratePrecedingAxis(NodePredicate predicate) Get an iterator over the preceding axis, starting at this node; the nodes will be in reverse document order.iteratePrecedingOrSelfAxis(NodePredicate predicate) Get an iterator over the preceding-or-self axis, starting at this node; the nodes will be in reverse document order.iteratePrecedingSiblingAxis(NodePredicate predicate) Get an iterator over the preceding-sibling axis, starting at this node; the nodes will be in reverse document order.iteratePrecedingSiblingOrSelfAxis(NodePredicate predicate) Get an iterator over the preceding-sibling-or-self axis, starting at this node; the nodes will be in reverse document order.iterateSelfAxis(NodePredicate predicate) Get an iterator over the self axis, starting at this node; there will be zero or one nodes.static RebasedNodemakeWrapper(NodeInfo node, RebasedDocument docWrapper, RebasedNode parent) Factory method to wrap a node with a wrapper that implements the Saxon NodeInfo interface.makeWrapper(NodeInfo node, VirtualNode parent) Factory method to wrap a node with a VirtualNodeMethods inherited from class net.sf.saxon.tree.wrapper.AbstractVirtualNode
atomize, generateId, getAllNamespaces, getAttributeValue, getColumnNumber, getDeclaredNamespaces, getDisplayName, getFingerprint, getLineNumber, getLocalPart, getNamespaceUri, getNodeKind, getPrefix, getRealNode, getRoot, getSchemaType, getTreeInfo, getUnderlyingNode, getUnicodeStringValue, hasChildNodes, hasFingerprint, isId, isIdref, isNilled, saveLocation, setSystemIdMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, effectiveBooleanValue, materializeMethods inherited from interface net.sf.saxon.om.Item
getLabel, getLength, getStringValue, head, itemAt, iterate, reduce, subsequenceMethods inherited from interface net.sf.saxon.om.NodeInfo
asActiveSource, attributes, children, children, copy, deliver, getConfiguration, getGenre, getPublicId, getQName, getURI, isSameNodeInfo, isStreamed, toShortStringMethods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
RebasedNode
protected RebasedNode() -
RebasedNode
This constructor is protected: nodes should be created using the makeWrapper factory method- Parameters:
node- The node to be wrappedparent- The RebasedNode that wraps the parent of this node
-
-
Method Details
-
makeWrapper
public static RebasedNode makeWrapper(NodeInfo node, RebasedDocument docWrapper, RebasedNode parent) Factory method to wrap a node with a wrapper that implements the Saxon NodeInfo interface.- Parameters:
node- The underlying nodedocWrapper- The wrapper for the document node (must be supplied)parent- The wrapper for the parent of the node (null if unknown)- Returns:
- The new wrapper for the supplied node
-
makeWrapper
Factory method to wrap a node with a VirtualNode- Specified by:
makeWrapperin interfaceWrappingFunction- Parameters:
node- The underlying nodeparent- The wrapper for the parent of the node (null if unknown)- Returns:
- The new wrapper for the supplied node
-
getBaseURI
Get the Base URI for the node, that is, the URI used for resolving a relative URI contained in the node.- Specified by:
getBaseURIin interfaceNodeInfo- Overrides:
getBaseURIin classAbstractVirtualNode- Returns:
- the base URI of the node. This may be null if the base URI is unknown, including the case where the node has no parent.
-
getSystemId
Get the System ID for the node.- Specified by:
getSystemIdin interfaceLocation- Specified by:
getSystemIdin interfaceLocator- Specified by:
getSystemIdin interfaceNodeInfo- Specified by:
getSystemIdin interfaceSource- Specified by:
getSystemIdin interfaceSourceLocator- Overrides:
getSystemIdin classAbstractVirtualNode- Returns:
- the System Identifier of the entity in the source document containing the node, or null if not known. Note this is not the same as the base URI: the base URI can be modified by xml:base, but the system ID cannot.
-
equals
Determine whether this is the same node as another node.Note: a.isSameNode(b) if and only if generateId(a)==generateId(b)
- Specified by:
equalsin interfaceNodeInfo- Overrides:
equalsin classAbstractVirtualNode- Parameters:
other- the node to be compared with this node- Returns:
- true if this Node object and the supplied Node object represent the same node in the tree.
-
hashCode
public int hashCode()The hashCode() method obeys the contract for hashCode(): that is, if two objects are equal (represent the same node) then they must have the same hashCode()- Specified by:
hashCodein interfaceNodeInfo- Overrides:
hashCodein classAbstractVirtualNode
-
compareOrder
Determine the relative position of this node and another node, in document order. The other node will always be in the same document.- Specified by:
compareOrderin interfaceGNode- Specified by:
compareOrderin interfaceNodeInfo- Overrides:
compareOrderin classAbstractVirtualNode- Parameters:
other- The other node, whose position is to be compared with this node- Returns:
- -1 if this node precedes the other node, +1 if it follows the other node, or 0 if they are the same node. (In this case, isSameNode() will always return true, and the two nodes will produce the same result for generateId())
-
getParent
Get the NodeInfo object representing the parent of this node -
iterateAncestorAxis
Get an iterator over the ancestor axis, starting at this node; the nodes will be in reverse document order.- Specified by:
iterateAncestorAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateAncestorOrSelfAxis
Get an iterator over the ancestor-or-self axis, starting at this node; the nodes will be in reverse document order.- Specified by:
iterateAncestorOrSelfAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateAttributeAxis
Get an iterator over the attribute axis, starting at this node; the nodes will be in document order.- Specified by:
iterateAttributeAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateChildAxis
Get an iterator over the child axis, starting at this node; the nodes will be in document order.- Specified by:
iterateChildAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateDescendantAxis
Get an iterator over the descendant axis, starting at this node; the nodes will be in document order.- Specified by:
iterateDescendantAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateDescendantOrSelfAxis
Get an iterator over the descendant-or-self axis, starting at this node; the nodes will be in document order.- Specified by:
iterateDescendantOrSelfAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateFollowingAxis
Get an iterator over the following axis, starting at this node; the nodes will be in document order.- Specified by:
iterateFollowingAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateFollowingOrSelfAxis
Get an iterator over the following-or-self axis, starting at this node; the nodes will be in document order.- Specified by:
iterateFollowingOrSelfAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateFollowingSiblingAxis
Get an iterator over the following-sibling axis, starting at this node; the nodes will be in document order.- Specified by:
iterateFollowingSiblingAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateFollowingSiblingOrSelfAxis
Get an iterator over the following-sibling-or-self axis, starting at this node; the nodes will be in document order.- Specified by:
iterateFollowingSiblingOrSelfAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateNamespaceAxis
Get an iterator over the namespace axis, starting at this node; the nodes will be in reverse document order. The default implementation must be overridden for classes that implement element nodes.- Specified by:
iterateNamespaceAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateParentAxis
Get an iterator over the parent axis, starting at this node; returns zero or one nodes- Specified by:
iterateParentAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iteratePrecedingAxis
Get an iterator over the preceding axis, starting at this node; the nodes will be in reverse document order.- Specified by:
iteratePrecedingAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iteratePrecedingOrSelfAxis
Get an iterator over the preceding-or-self axis, starting at this node; the nodes will be in reverse document order.- Specified by:
iteratePrecedingOrSelfAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iteratePrecedingSiblingAxis
Get an iterator over the preceding-sibling axis, starting at this node; the nodes will be in reverse document order.- Specified by:
iteratePrecedingSiblingAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iteratePrecedingSiblingOrSelfAxis
Get an iterator over the preceding-sibling-or-self axis, starting at this node; the nodes will be in reverse document order.- Specified by:
iteratePrecedingSiblingOrSelfAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iterateSelfAxis
Get an iterator over the self axis, starting at this node; there will be zero or one nodes.- Specified by:
iterateSelfAxisin interfaceGNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-