Class TinyTextualElement

All Implemented Interfaces:
Iterable<NodeInfo>, Source, SourceLocator, Location, GroundedValue<NodeInfo>, Item<NodeInfo>, NodeInfo, Sequence<NodeInfo>, Locator

public class TinyTextualElement extends TinyElementImpl
An element node in the TinyTree that has no attributes or namespace declarations and that has a single text node child. The element-and-text-node pair are represented by a single entry in the node arrays, but materialize as two separate objects when turned into node objects.
  • Constructor Details

    • TinyTextualElement

      public TinyTextualElement(TinyTree tree, int nodeNr)
  • Method Details

    • getDeclaredNamespaces

      public NamespaceBinding[] getDeclaredNamespaces(NamespaceBinding[] buffer)
      Description copied from class: TinyElementImpl
      Get all namespace undeclarations and undeclarations defined on this element.
      Specified by:
      getDeclaredNamespaces in interface NodeInfo
      Overrides:
      getDeclaredNamespaces in class TinyElementImpl
      Parameters:
      buffer - If this is non-null, and the result array fits in this buffer, then the result may overwrite the contents of this array, to avoid the cost of allocating a new array on the heap.
      Returns:
      An array of objects representing the namespace declarations and undeclarations present on this element. For a node other than an element, return null. Otherwise, the returned array is a sequence of namespace binding objects (essentially prefix/uri pairs) If the URI is null, then this is a namespace undeclaration rather than a declaration. The XML namespace is never included in the list. If the supplied array is larger than required, then the first unused entry will be set to null.
    • getAttributeValue

      public String getAttributeValue(String uri, String local)
      Description copied from class: TinyElementImpl
      Get the string value of a given attribute of this node
      Specified by:
      getAttributeValue in interface NodeInfo
      Overrides:
      getAttributeValue in class TinyElementImpl
      Parameters:
      uri - the namespace URI of the attribute name. Supply the empty string for an attribute that is in no namespace
      local - the local part of the attribute name.
      Returns:
      the attribute value if it exists, or null if it does not exist. Always returns null if this node is not an element.
    • getAttributeValue

      public String getAttributeValue(int fp)
      Description copied from class: TinyElementImpl
      Get the value of the attribute with a given fingerprint.
      Overrides:
      getAttributeValue in class TinyElementImpl
      Parameters:
      fp - the fingerprint of the required attribute
      Returns:
      the string value of the attribute if present, or null if absent
    • copy

      public void copy(Receiver receiver, int copyOptions, Location location) throws XPathException
      Description copied from class: TinyElementImpl
      Copy this node to a given receiver
      Specified by:
      copy in interface NodeInfo
      Overrides:
      copy in class TinyElementImpl
      Parameters:
      receiver - 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 - determines handling of namespaces, etc
      location - location information associated with the event
      Throws:
      XPathException - if any downstream error occurs
    • hasChildNodes

      public boolean hasChildNodes()
      Description copied from class: TinyParentNodeImpl
      Determine if the node has children.
      Specified by:
      hasChildNodes in interface NodeInfo
      Overrides:
      hasChildNodes in class TinyParentNodeImpl
      Returns:
      true if this node has any attributes, false otherwise.
    • getStringValueCS

      public CharSequence getStringValueCS()
      Description copied from class: TinyParentNodeImpl
      Get the value of the item as a CharSequence. This is in some cases more efficient than the version of the method that returns a String.
      Specified by:
      getStringValueCS in interface GroundedValue<NodeInfo>
      Specified by:
      getStringValueCS in interface Item<NodeInfo>
      Overrides:
      getStringValueCS in class TinyParentNodeImpl
      Returns:
      the string value of the item
      See Also:
    • getStringValue

      public String getStringValue()
      Description copied from class: TinyParentNodeImpl
      Return the string-value of the node, that is, the concatenation of the character content of all descendent elements and text nodes.
      Specified by:
      getStringValue in interface GroundedValue<NodeInfo>
      Specified by:
      getStringValue in interface Item<NodeInfo>
      Specified by:
      getStringValue in interface NodeInfo
      Overrides:
      getStringValue in class TinyParentNodeImpl
      Returns:
      the accumulated character content of the element, including descendant elements.
      See Also:
    • iterateAxis

      public AxisIterator iterateAxis(byte axisNumber)
      Description copied from class: TinyNodeImpl
      Return an iterator over all the nodes reached by the given axis from this node
      Specified by:
      iterateAxis in interface NodeInfo
      Overrides:
      iterateAxis in class TinyNodeImpl
      Parameters:
      axisNumber - Identifies the required axis, eg. Axis.CHILD or Axis.PARENT
      Returns:
      a AxisIteratorImpl that scans the nodes reached by the axis in turn.
      See Also:
    • iterateAxis

      public AxisIterator iterateAxis(byte axisNumber, NodeTest nodeTest)
      Description copied from class: TinyNodeImpl
      Return an iterator over the nodes reached by the given axis from this node
      Specified by:
      iterateAxis in interface NodeInfo
      Overrides:
      iterateAxis in class TinyNodeImpl
      Parameters:
      axisNumber - Identifies the required axis, eg. Axis.CHILD or Axis.PARENT
      nodeTest - A pattern to be matched by the returned nodes.
      Returns:
      a AxisIteratorImpl that scans the nodes reached by the axis in turn.
      See Also:
    • isAncestorOrSelf

      public boolean isAncestorOrSelf(TinyNodeImpl d)
      Description copied from class: TinyNodeImpl
      Test if this node is an ancestor-or-self of another
      Overrides:
      isAncestorOrSelf in class TinyNodeImpl
      Parameters:
      d - the putative descendant-or-self node
      Returns:
      true if this node is an ancestor-or-self of d
    • getTextNode

      Make an instance of the text node
      Returns:
      the new or existing instance