Package cdc.util.data

Interface Node

    • Field Detail

      • ANY_NODE

        static final Predicate<Node> ANY_NODE
        A Node Predicate that always return true.
      • IS_COMMENT

        static final Predicate<Node> IS_COMMENT
        A Node Predicate that returns true when the node is a Comment.
      • IS_ELEMENT

        static final Predicate<Node> IS_ELEMENT
        A Node Predicate that returns true when the node is an Element.
      • IS_TEXT

        static final Predicate<Node> IS_TEXT
        A Node Predicate that returns true when the node is a Text.
      • IS_PURE_ELEMENT

        static final Predicate<Node> IS_PURE_ELEMENT
        A Node Predicate that returns true when the node is an Element that has no attributes and no children .
      • IS_IGNORABLE_TEXT

        static final Predicate<Node> IS_IGNORABLE_TEXT
        A Node Predicate that returns true when the node is a Text that is ignorable.
      • ELEMENT_NAME_COMPARATOR

        static final Comparator<Node> ELEMENT_NAME_COMPARATOR
      • ELEMENT_NAME_AND_ATTRIBUTES_COMPARATOR

        static final Comparator<Node> ELEMENT_NAME_AND_ATTRIBUTES_COMPARATOR
    • Method Detail

      • getNameAndAttributes

        static String getNameAndAttributes​(Element element)
      • getType

        NodeType getType()
        Returns:
        The node type.
      • clone

        Node clone​(boolean recurse)
        Return a clone of this node.
        Parameters:
        recurse - If true, also clone children nodes.
        Returns:
        A clone of this node, and optionally its children.
      • deepEquals

        boolean deepEquals​(Node node)
        Return true when this node and its descendants equals other node hierarchy.

        Parents are ignored.

        Parameters:
        node - The other node to compare.
        Returns:
        True when this node and other node have same hierarchies.
      • getDocument

        Document getDocument()
        Returns:
        The document of this node, possibly null.
      • getRootElement

        Element getRootElement()
        Returns the root element of this node.

        If this node is a document, then this is its unique child element, possibly null.
        If this node is a child, then this is the highest ancestor that is an element, possibly null.

        Returns:
        The root element of this node, possibly null.
      • getQName

        String getQName()
        Returns:
        A string representation of this node. May be used for debug.