Package groovy.xml.dom
Class DOMCategory
java.lang.Object
groovy.xml.dom.DOMCategory
Category class which adds GPath style operations to Java's DOM classes.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic ElementappendNode(Element self, Object name) static ElementappendNode(Element self, Object name, String value) static ElementappendNode(Element self, Object name, Map attributes) static ElementappendNode(Element self, Object name, Map attributes, String value) static NamedNodeMapattributes(Element element) static NodeListbreadthFirst(Element self) static NodeListstatic NodeListdepthFirst(Element self) static Objectstatic Objectget(NamedNodeMap nodeMap, String elementName) static Objectstatic NodegetAt(groovy.xml.dom.DOMCategory.NodeListsHolder o, int i) static NodeListstatic NodegetAt(groovy.xml.dom.DOMCategory.NodesHolder o, int i) static NodeListstatic Nodestatic NodeListstatic booleanstatic booleanstatic booleanReturns the list of any direct String nodes of this node.static Stringstatic Nodestatic voidstatic voidstatic voidstatic NodereplaceNode(groovy.xml.dom.DOMCategory.NodesHolder self, Closure c) static NodereplaceNode(Node self, Closure c) static voidsetGlobalKeepIgnorableWhitespace(boolean keepIgnorableWhitespace) Whether ignorable whitespace (e.g.static voidsetGlobalTrimWhitespace(boolean trimWhitespace) Whether text content is trimmed (removing leading and trailing whitespace); default false.static voidstatic intsize(NamedNodeMap namedNodeMap) static intstatic Stringstatic Stringstatic Stringstatic Stringstatic Object
- 
Constructor Details- 
DOMCategorypublic DOMCategory()
 
- 
- 
Method Details- 
isGlobalTrimWhitespacepublic static boolean isGlobalTrimWhitespace()- Returns:
- true if text elements are trimmed before returning; default false
 
- 
setGlobalTrimWhitespacepublic 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
 
- 
isGlobalKeepIgnorableWhitespacepublic static boolean isGlobalKeepIgnorableWhitespace()- Returns:
- true if ignorable whitespace (e.g. whitespace between elements) is kept; default false
 
- 
setGlobalKeepIgnorableWhitespacepublic 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
 
- 
get
- 
get
- 
get
- 
attributes
- 
size
- 
getAt
- 
getAt
- 
getAt
- 
getAt
- 
getAt
- 
getAt
- 
name
- 
parent
- 
text
- 
text
- 
list
- 
depthFirst
- 
setValue
- 
putAt
- 
appendNode
- 
appendNode
- 
appendNode
- 
appendNode
- 
replaceNode
- 
replaceNode
- 
plus
- 
localTextReturns the list of any direct String nodes of this node.- Returns:
- the list of String values from this node
- Since:
- 2.3.0
 
- 
plus
- 
breadthFirst
- 
children
- 
toString
- 
xpath
- 
xpath
- 
size
- 
isEmpty
 
-