net.sf.saxon.tree.wrapper

## Class VirtualUntypedCopy

- java.lang.Object
- - net.sf.saxon.tree.wrapper.VirtualCopy
  - - net.sf.saxon.tree.wrapper.VirtualUntypedCopy

- All Implemented Interfaces:
    Source, SourceLocator, PullEvent, Item, NodeInfo, Sequence

      public class VirtualUntypedCopy
      extends VirtualCopy

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

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `VirtualUntypedCopy.VirtualUntypedCopier`

    - ### Nested classes/interfaces inherited from class net.sf.saxon.tree.wrapper.VirtualCopy

      `VirtualCopy.VirtualCopier`

  - ### Field Summary

    - ### Fields inherited from class net.sf.saxon.tree.wrapper.VirtualCopy

      `documentNumber, original, parent, root, systemId`

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

      `ALL_NAMESPACES, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `VirtualUntypedCopy(NodeInfo base)` Protected constructor: create a virtual copy of a node

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `AtomicSequence` | `atomize()` Get the typed value.
    `void` | `copy(Receiver out, int copyOptions, int locationId)` Copy this node to a given outputter
    `SchemaType` | `getSchemaType()` Get the type annotation of this node, if any.
    `int` | `getTypeAnnotation()` Get the type annotation of this node, if any.
    `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.tree.wrapper.VirtualCopy

      `compareOrder, comparePosition, equals, generateId, getAttributeValue, getBaseURI, getColumnNumber, getConfiguration, getDeclaredNamespaces, getDisplayName, getDocumentNumber, getDocumentRoot, getFingerprint, getLineNumber, getLocalPart, getNameCode, getNamePool, getNodeKind, getParent, getPrefix, getPublicId, getRoot, getStringValue, getStringValueCS, getSystemId, getURI, hasChildNodes, hashCode, head, isId, isIdref, isNilled, isSameNodeInfo, iterate, iterateAxis, iterateAxis, makeVirtualCopy, setDocumentNumber, setSystemId, wrap`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### VirtualUntypedCopy

          protected VirtualUntypedCopy(NodeInfo base)

      Protected constructor: create a virtual copy of a node
      Parameters:
        `base` - the node to be copied

  - ### Method Detail

    - #### 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.

    - #### getTypeAnnotation

          public int getTypeAnnotation()

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

    - #### getSchemaType

          public SchemaType getSchemaType()

      Get the type annotation of this node, if any. The type annotation is represented as SchemaType object.

      Types derived from a DTD are not reflected in the result of this method.

      Specified by:
        `getSchemaType` in interface `NodeInfo`
      Overrides:
        `getSchemaType` in class `VirtualCopy`
      Returns:
        For element and attribute nodes: the type annotation derived from schema validation (defaulting to xs:untyped and xs:untypedAtomic in the absence of schema validation). For comments, text nodes, processing instructions, and namespaces: null. For document nodes, either xs:untyped if the document has not been validated, or xs:anyType if it has.
      Since:
        9.4

    - #### atomize

          public AtomicSequence atomize()
                                 throws XPathException

      Get the typed value. The result of this method will always be consistent with the method `net.sf.saxon.om.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 class `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.
      Throws:
        `XPathException` - if the node has no typed value, for example if it is an element node with element-only content
      Since:
        8.5

    - #### copy

          public void copy(Receiver out,
                  int copyOptions,
                  int locationId)
                    throws XPathException

      Description copied from class: `VirtualCopy`
      Copy this node to a given outputter
      Specified by:
        `copy` in interface `NodeInfo`
      Overrides:
        `copy` in class `VirtualCopy`
      Parameters:
        `out` - the Receiver to which the node should be copied
        `copyOptions` - a selection of the options defined in `CopyOptions`
        `locationId` - Identifies the location of the instruction
      Throws:
        `XPathException` - if any downstream error occurs

    - #### 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 class `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
      Returns:
        the iterator that does the copying

Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.