Class RootJNode

java.lang.Object
net.sf.saxon.ma.jnode.JNode
net.sf.saxon.ma.jnode.RootJNode
All Implemented Interfaces:
GNode, GroundedValue, Item, Sequence

public class RootJNode extends JNode
A root JNode that wraps a map or array
  • Constructor Details

    • RootJNode

      public RootJNode(MapOrArray value)
      Construct a JNode that wraps a given map or array
      Parameters:
      value - the map or array to be wrapped
  • Method Details

    • obtainRootJNode

      public static RootJNode obtainRootJNode(MapOrArray value)
    • getContent

      public MapOrArray getContent()
      Get the value/content property of the JNode
      Specified by:
      getContent in class JNode
      Returns:
      the wrapped value/content
    • getPosition

      public int getPosition()
      Get the position property of the JNode
      Specified by:
      getPosition in class JNode
      Returns:
      always absent for a root JNode: return -1
    • getSelector

      public AtomicValue getSelector()
      Get the selector property of the JNode
      Specified by:
      getSelector in class JNode
      Returns:
      always absent for a root JNode: return null
    • getParent

      public JNode getParent()
      Get the parent property of the JNode
      Specified by:
      getParent in interface GNode
      Specified by:
      getParent in class JNode
      Returns:
      always absent for a root JNode: return null
    • getChildren

      public SequenceIterator getChildren()
      Get the children of the JNode
      Returns:
      a sequence of JNodes that wrap the array members or map entries
    • iterateChildAxis

      public SequenceIterator iterateChildAxis(NodePredicate predicate)
      Get an iterator over the child axis, starting at this node; the nodes will be in document order.
      Parameters:
      predicate - a condition that the nodes must satisfy, or null
      Returns:
      the required iterator
    • iterateFollowingSiblingAxis

      public SequenceIterator iterateFollowingSiblingAxis(NodePredicate predicate)
      Get an iterator over the following-sibling axis, starting at this node; the nodes will be in document order.
      Parameters:
      predicate - a condition that the nodes must satisfy, or null
      Returns:
      the required iterator
    • iteratePrecedingSiblingAxis

      public SequenceIterator iteratePrecedingSiblingAxis(NodePredicate predicate)
      Get an iterator over the preceding-sibling axis, starting at this node; the nodes will be in reverse document order.
      Parameters:
      predicate - a condition that the nodes must satisfy, or null
      Returns:
      the required iterator
    • compareOrder

      public int compareOrder(GNode other)
      Compare document order of this node against another node.

      The other node must always be in the same tree; the effect of calling this method when the two nodes are in different trees is undefined. To obtain a global ordering of nodes, the application should first compare the result of getDocumentNumber(), and only if the document number is the same should compareOrder() be called.

      Parameters:
      other - the other node
      Returns:
      -1 if this node precedes the other, 0 if they are the same node, +1 if this node follows the other
    • generateId

      public void generateId(StringBuilder buffer)
      Construct a character string that uniquely identifies this node. Note: a.isSameNode(b) if and only if generateId(a)==generateId(b)
      Parameters:
      buffer - a buffer which will be updated to hold a string that uniquely identifies this node, across all documents.
      Since:
      8.7

      Changed in Saxon 8.7 to generate the ID value in a client-supplied buffer