Class DOMCategory


  • public class DOMCategory
    extends Object
    Category class which adds GPath style operations to Java's DOM classes.
    • Constructor Detail

      • DOMCategory

        public DOMCategory()
    • Method Detail

      • isGlobalTrimWhitespace

        public static boolean isGlobalTrimWhitespace()
        Returns:
        true if text elements are trimmed before returning; default false
      • setGlobalTrimWhitespace

        public static void setGlobalTrimWhitespace​(boolean trimWhitespace)
        Whether text content is trimmed (removing leading and trailing whitespace); default false. WARNING: this is a global setting. Altering it will affect all DOMCategory usage within the current Java process. It is not recommended that this is altered; instead call the trim() method on the returned text, but the flag is available to support legacy Groovy behavior.
        Parameters:
        trimWhitespace - the new value
      • isGlobalKeepIgnorableWhitespace

        public static boolean isGlobalKeepIgnorableWhitespace()
        Returns:
        true if ignorable whitespace (e.g. whitespace between elements) is kept; default false
      • setGlobalKeepIgnorableWhitespace

        public static void setGlobalKeepIgnorableWhitespace​(boolean keepIgnorableWhitespace)
        Whether ignorable whitespace (e.g. whitespace between elements) is kept (default false). WARNING: this is a global setting. Altering it will affect all DOMCategory usage within the current Java process.
        Parameters:
        keepIgnorableWhitespace - the new value
      • size

        public static int size​(NamedNodeMap namedNodeMap)
      • getAt

        public static Node getAt​(Node o,
                                 int i)
      • getAt

        public static Node getAt​(groovy.xml.dom.DOMCategory.NodeListsHolder o,
                                 int i)
      • getAt

        public static Node getAt​(groovy.xml.dom.DOMCategory.NodesHolder o,
                                 int i)
      • getAt

        public static NodeList getAt​(groovy.xml.dom.DOMCategory.NodeListsHolder o,
                                     IntRange r)
      • getAt

        public static NodeList getAt​(groovy.xml.dom.DOMCategory.NodesHolder o,
                                     IntRange r)
      • parent

        public static Node parent​(Node node)
      • setValue

        public static void setValue​(Element self,
                                    String value)
      • replaceNode

        public static Node replaceNode​(groovy.xml.dom.DOMCategory.NodesHolder self,
                                       Closure c)
      • localText

        public static List<String> localText​(Element self)
        Returns the list of any direct String nodes of this node.
        Returns:
        the list of String values from this node
        Since:
        2.3.0
      • size

        public static int size​(NodeList self)
      • isEmpty

        public static boolean isEmpty​(NodeList self)