Class TypeStrippedNode
java.lang.Object
net.sf.saxon.tree.wrapper.AbstractVirtualNode
net.sf.saxon.tree.wrapper.TypeStrippedNode
- All Implemented Interfaces:
Source, PullEvent, Item<NodeInfo>, NodeInfo, ValueRepresentation<NodeInfo>, VirtualNode, WrappingFunction
- Direct Known Subclasses:
TypeStrippedDocument
A TypeStrippedNode is a view of a node, in a virtual tree that has type
annotations stripped from it.
-
Field Summary
Fields inherited from class AbstractVirtualNode
docWrapper, node, parentFields inherited from interface NodeInfo
ALL_NAMESPACES, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACESFields inherited from interface ValueRepresentation
EMPTY_VALUE_ARRAY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedTypeStrippedNode(NodeInfo node, TypeStrippedNode parent) This constructor is protected: nodes should be created using the makeWrapper factory method -
Method Summary
Modifier and TypeMethodDescriptionatomize()Get the typed value.intcompareOrder(NodeInfo other) Determine the relative position of this node and another node, in document order.voidCopy this node to a given outputter (deep copy)Get the root (document) nodeGet the NodeInfo object representing the parent of this nodeGet the type annotationintGet the type annotationbooleanisSameNodeInfo(NodeInfo other) Determine whether this is the same node as another node.iterateAxis(byte axisNumber) Return an iteration over the nodes reached by the given axis from this nodestatic TypeStrippedNodemakeWrapper(NodeInfo node, TypeStrippedDocument docWrapper, TypeStrippedNode 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 AbstractVirtualNode
equals, generateId, getAttributeValue, getAttributeValue, getBaseURI, getColumnNumber, getConfiguration, getDeclaredNamespaces, getDisplayName, getDocumentNumber, getFingerprint, getLineNumber, getLocalPart, getNameCode, getNamePool, getNodeKind, getPrefix, getRealNode, getRoot, getStringValue, getStringValueCS, getSystemId, getTypedValue, getUnderlyingNode, getURI, hasChildNodes, hashCode, isId, isIdref, isNilled, iterateAxis, setSystemId
-
Constructor Details
-
TypeStrippedNode
protected TypeStrippedNode() -
TypeStrippedNode
This constructor is protected: nodes should be created using the makeWrapper factory method- Parameters:
node- The node to be wrappedparent- The StrippedNode that wraps the parent of this node
-
-
Method Details
-
makeWrapper
public static TypeStrippedNode makeWrapper(NodeInfo node, TypeStrippedDocument docWrapper, TypeStrippedNode 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
-
atomize
Get the typed value. The result of this method will always be consistent with the methodItem.getTypedValue(). However, this method is often more convenient and may be more efficient, especially in the common case where the value is expected to be a singleton.- Specified by:
atomizein interfaceNodeInfo- Overrides:
atomizein classAbstractVirtualNode- Returns:
- the typed value. If requireSingleton is set to true, the result will always be an AtomicValue. In other cases it may be a Value representing a sequence whose items are atomic values.
- Throws:
XPathException- if the node has no typed value, for example if it is an element node with element-only content- Since:
- 8.5
-
getTypeAnnotation
public int getTypeAnnotation()Get the type annotation- Specified by:
getTypeAnnotationin interfaceNodeInfo- Overrides:
getTypeAnnotationin classAbstractVirtualNode- Returns:
- untyped or untypedAtomic (the purpose of this class is to strip the type annotation)
-
getSchemaType
Get the type annotation- Specified by:
getSchemaTypein interfaceNodeInfo- Overrides:
getSchemaTypein classAbstractVirtualNode- Returns:
- the type annotation of the base node
-
isSameNodeInfo
Determine whether this is the same node as another node.
Note: a.isSameNode(b) if and only if generateId(a)==generateId(b)- Specified by:
isSameNodeInfoin interfaceNodeInfo- Overrides:
isSameNodeInfoin 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.
-
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 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
-
iterateAxis
Return an iteration over the nodes reached by the given axis from this node- Specified by:
iterateAxisin interfaceNodeInfo- Parameters:
axisNumber- the axis to be used- Returns:
- a SequenceIterator that scans the nodes reached by the axis in turn.
- See Also:
-
getDocumentRoot
Get the root (document) node- Specified by:
getDocumentRootin interfaceNodeInfo- Overrides:
getDocumentRootin classAbstractVirtualNode- Returns:
- the DocumentInfo representing the containing document
-
copy
Copy this node to a given outputter (deep copy)- Specified by:
copyin interfaceNodeInfo- Parameters:
out- the Receiver to which the node should be copied. It is the caller's responsibility to ensure that this Receiver is open before the method is called (or that it is self-opening), and that it is closed after use.copyOptions- a selection of the options defined inCopyOptionslocationId- If non-zero, identifies the location of the instruction that requested this copy. If zero, indicates that the location information- Throws:
XPathException- if any downstream error occurs
-