Package net.sf.saxon.tree.wrapper
Class TypeStrippedNode
- java.lang.Object
-
- net.sf.saxon.tree.wrapper.AbstractVirtualNode
-
- net.sf.saxon.tree.wrapper.TypeStrippedNode
-
- All Implemented Interfaces:
javax.xml.transform.Source
,javax.xml.transform.SourceLocator
,ActiveSource
,GroundedValue
,Item
,NodeInfo
,Sequence
,Location
,VirtualNode
,WrappingFunction
,org.xml.sax.Locator
public class TypeStrippedNode extends AbstractVirtualNode implements WrappingFunction
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 net.sf.saxon.tree.wrapper.AbstractVirtualNode
docWrapper, node, parent
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TypeStrippedNode()
protected
TypeStrippedNode(NodeInfo node, TypeStrippedNode parent)
This constructor is protected: nodes should be created using the makeWrapper factory method
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AtomicSequence
atomize()
Get the typed value.int
compareOrder(NodeInfo other)
Determine the relative position of this node and another node, in document order.void
copy(Receiver out, int copyOptions, Location locationId)
Copy this node to a given outputter (deep copy)boolean
equals(java.lang.Object other)
Determine whether this is the same node as another node.NodeInfo
getParent()
Get the NodeInfo object representing the parent of this nodeSchemaType
getSchemaType()
Get the type annotationint
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()boolean
isNilled()
Determine whether the node has the is-nilled propertyAxisIterator
iterateAxis(int axisNumber)
Return an iteration over the nodes reached by the given axis from this nodestatic TypeStrippedNode
makeWrapper(NodeInfo node, TypeStrippedDocument docWrapper, TypeStrippedNode parent)
Factory method to wrap a node with a wrapper that implements the Saxon NodeInfo interface.VirtualNode
makeWrapper(NodeInfo node, VirtualNode parent)
Factory method to wrap a node with a VirtualNode-
Methods inherited from class net.sf.saxon.tree.wrapper.AbstractVirtualNode
generateId, getAllNamespaces, getAttributeValue, getBaseURI, getColumnNumber, getDeclaredNamespaces, getDisplayName, getFingerprint, getLineNumber, getLocalPart, getNamespaceUri, getNodeKind, getPrefix, getRealNode, getRoot, getSystemId, getTreeInfo, getUnderlyingNode, getUnicodeStringValue, hasChildNodes, hasFingerprint, isId, isIdref, iterateAxis, saveLocation, setSystemId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, effectiveBooleanValue, materialize
-
Methods inherited from interface net.sf.saxon.om.Item
getLength, getStringValue, head, itemAt, iterate, reduce, subsequence
-
Methods inherited from interface net.sf.saxon.om.NodeInfo
asActiveSource, attributes, children, children, deliver, getAttributeValue, getConfiguration, getGenre, getPublicId, getURI, isSameNodeInfo, isStreamed, toShortString
-
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
-
-
-
Constructor Detail
-
TypeStrippedNode
protected TypeStrippedNode()
-
TypeStrippedNode
protected TypeStrippedNode(NodeInfo node, TypeStrippedNode parent)
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 Detail
-
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
public VirtualNode makeWrapper(NodeInfo node, VirtualNode parent)
Factory method to wrap a node with a VirtualNode- Specified by:
makeWrapper
in 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
public AtomicSequence atomize() throws XPathException
Get the typed value.- Specified by:
atomize
in interfaceItem
- Specified by:
atomize
in interfaceNodeInfo
- Overrides:
atomize
in 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
-
getSchemaType
public SchemaType getSchemaType()
Get the type annotation- Specified by:
getSchemaType
in interfaceNodeInfo
- Overrides:
getSchemaType
in classAbstractVirtualNode
- Returns:
- the type annotation of the base node
-
equals
public boolean equals(java.lang.Object other)
Determine whether this is the same node as another node.Note: a.isSameNode(b) if and only if generateId(a)==generateId(b)
- Specified by:
equals
in interfaceNodeInfo
- Overrides:
equals
in 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:
hashCode
in interfaceNodeInfo
- Overrides:
hashCode
in classAbstractVirtualNode
-
compareOrder
public int compareOrder(NodeInfo other)
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:
compareOrder
in interfaceNodeInfo
- Overrides:
compareOrder
in 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
public NodeInfo getParent()
Get the NodeInfo object representing the parent of this node
-
iterateAxis
public AxisIterator iterateAxis(int axisNumber)
Return an iteration over the nodes reached by the given axis from this node- Specified by:
iterateAxis
in interfaceNodeInfo
- Parameters:
axisNumber
- the axis to be used- Returns:
- a SequenceIterator that scans the nodes reached by the axis in turn.
- See Also:
AxisInfo
-
copy
public void copy(Receiver out, int copyOptions, Location locationId) throws XPathException
Copy this node to a given outputter (deep copy)- Specified by:
copy
in 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 inCopyOptions
locationId
- If non-null, identifies the location of the instruction that requested this copy. If null, indicates that the location information is not available- Throws:
XPathException
- if any downstream error occurs
-
isNilled
public boolean isNilled()
Description copied from class:AbstractVirtualNode
Determine whether the node has the is-nilled property- Specified by:
isNilled
in interfaceNodeInfo
- Overrides:
isNilled
in classAbstractVirtualNode
- Returns:
- true if the node has the is-nilled property
-
-