net.sf.saxon.om

Class VirtualUntypedCopy

Implemented Interfaces:
Item, NodeInfo, Source, PullEvent, ValueRepresentation

public class VirtualUntypedCopy
extends VirtualCopy

This class represents a virtual copy of a node with type annotations stripped

Nested Class Summary

protected class
VirtualUntypedCopy.VirtualUntypedCopier

Nested classes/interfaces inherited from class net.sf.saxon.om.VirtualCopy

VirtualCopy.VirtualCopier

Field Summary

Fields inherited from class net.sf.saxon.om.VirtualCopy

documentNumber, original, parent, root, systemId

Fields inherited from interface net.sf.saxon.om.NodeInfo

ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES

Fields inherited from interface net.sf.saxon.om.ValueRepresentation

EMPTY_VALUE_ARRAY

Constructor Summary

VirtualUntypedCopy(NodeInfo base)
Protected constructor: create a virtual copy of a node

Method Summary

Value
atomize()
Get the typed value.
void
copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId)
Copy this node to a given Receiver.
int
getTypeAnnotation()
Get the type annotation of this node, if any.
SequenceIterator
getTypedValue()
Get the typed value of the item
protected VirtualCopy.VirtualCopier
makeCopier(AxisIterator axis, VirtualCopy newParent, NodeInfo root)
Create an iterator that makes and returns virtual copies of nodes on the original tree
static VirtualCopy
makeVirtualUntypedCopy(NodeInfo original, NodeInfo root)
Public factory method: create an untyped virtual copy of a node

Methods inherited from class net.sf.saxon.om.VirtualCopy

atomize, compareOrder, copy, equals, generateId, getAttributeValue, getBaseURI, getConfiguration, getDeclaredNamespaces, getDisplayName, getDocumentNumber, getDocumentRoot, getFingerprint, getLineNumber, getLocalPart, getNameCode, getNamePool, getNodeKind, getParent, getPrefix, getRoot, getStringValue, getStringValueCS, getSystemId, getTypeAnnotation, getTypedValue, getURI, hasChildNodes, hashCode, isSameNodeInfo, iterateAxis, iterateAxis, makeCopier, makeVirtualCopy, setDocumentNumber, setSystemId, wrap

Constructor Details

VirtualUntypedCopy

protected VirtualUntypedCopy(NodeInfo base)
Protected constructor: create a virtual copy of a node
Parameters:
base - the node to be copied

Method Details

atomize

public Value atomize()
            throws XPathException
Get the typed value. The result of this method will always be consistent with the method Item.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:
atomize in interface NodeInfo
Overrides:
atomize in interface VirtualCopy
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.
Since:
8.5

copy

public void copy(Receiver out,
                 int whichNamespaces,
                 boolean copyAnnotations,
                 int locationId)
            throws XPathException
Copy this node to a given Receiver.

This method is primarily for internal use. It should not be considered a stable part of the Saxon API.

Specified by:
copy in interface NodeInfo
Overrides:
copy in interface VirtualCopy
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.
whichNamespaces - in the case of an element, controls which namespace nodes should be copied. Values are NodeInfo.NO_NAMESPACES, NodeInfo.LOCAL_NAMESPACES, NodeInfo.ALL_NAMESPACES
copyAnnotations - indicates whether the type annotations of element and attribute nodes should be copied
locationId - If non-zero, identifies the location of the instruction that requested this copy. If zero, indicates that the location information for the original node is to be copied; in this case the Receiver must be a LocationCopier
Throws:
XPathException -

getTypeAnnotation

public int getTypeAnnotation()
Get the type annotation of this node, if any.
Specified by:
getTypeAnnotation in interface NodeInfo
Overrides:
getTypeAnnotation in interface VirtualCopy
Returns:
the type annotation of the node.
See Also:
Type

getTypedValue

public SequenceIterator getTypedValue()
            throws XPathException
Get the typed value of the item
Specified by:
getTypedValue in interface Item
Overrides:
getTypedValue in interface VirtualCopy
Returns:
the typed value of the item. In general this will be a sequence
Throws:
XPathException - where no typed value is available, e.g. for an element with complex content

makeCopier

protected VirtualCopy.VirtualCopier makeCopier(AxisIterator axis,
                                               VirtualCopy newParent,
                                               NodeInfo root)
Create an iterator that makes and returns virtual copies of nodes on the original tree
Overrides:
makeCopier in interface VirtualCopy
Parameters:
axis - the axis to be navigated
newParent - the parent of the nodes in the new virtual tree (may be null)
root - the root of the virtual tree

makeVirtualUntypedCopy

public static VirtualCopy makeVirtualUntypedCopy(NodeInfo original,
                                                 NodeInfo root)
Public factory method: create an untyped virtual copy of a node
Parameters:
original - the node to be copied
root - the root of the tree
Returns:
the virtual copy.