Class XdmJNode

All Implemented Interfaces:
Iterable<XdmItem>

public class XdmJNode extends XdmItem
This class represents a JNode in the XDM data model. An XdmJNode is an XdmItem, and is therefore an XdmValue in its own right, and may also participate as one item within a sequence value.

An XdmJNode is implemented as a wrapper around an object of type JNode.

The XdmJNode interface exposes basic properties of the JNode, such as its parent, its selector, its position, and its contained value.

Since:
13.0
  • Constructor Details

    • XdmJNode

      public XdmJNode(JNode node)
      Construct an XdmJNode as a wrapper around an existing JNode object. This constructor is intended primarily for system use.
      Parameters:
      node - the JNode object to be wrapped. This can be retrieved using the getUnderlyingValue() method.
  • Method Details

    • getContent

      public XdmValue getContent()
      Get the content property of the JNode.
      Returns:
      the value of the content property
    • getUnderlyingValue

      public JNode getUnderlyingValue()
      Get the underlying implementation object representing the JNode. This method allows access to lower-level Saxon functionality, including classes and methods that offer no guarantee of stability across releases.
      Overrides:
      getUnderlyingValue in class XdmItem
      Returns:
      the underlying implementation object representing the JNode
    • getSelector

      public XdmAtomicValue getSelector()
      Get the selector of the JNode, as an XdmAtomicValue
      Returns:
      the selector of the JNode. Returns null for a root JNode; otherwise the key value for a JNode representing an entry in a map, or the 1-based index for a JNode representing a member of an array.
    • getPosition

      public int getPosition()
      Get the position of the JNode, as an integer
      Returns:
      the integer of the JNode. Returns -1 for a root JNode; otherwise the position of the JNode within a sequence-valued parent (normally 1, since array members and map entry values are usually singletons)