{foo a=1 b="abc"} or nested
metadata like {foo a=1 b="123" { bar x=12 text="hello" }}
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final Object | |
| private Node | |
| private static final long | |
| private Object |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | Node(Node
the parent node or null if no parent parent, Object the name of the node name, Map<K, V> a Map of name-value pairs attributes, Object the Node value, e.g. some text but in general any Object value)Creates a new Node named |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public Node | Returns: the newly createdNodethe name of the new node name, Map<K, V> the attributes of the new node attributes)Creates a new node as a child of the current node. |
| public Node | Returns: the newly createdNodethe name of the new node name)Creates a new node as a child of the current node. |
| public Node | Returns: the newly createdNodethe name of the new node name, Object the value of the new node value)Creates a new node as a child of the current node. |
| public Node | Returns: the newly createdNodethe name of the new node name, Map<K, V> the attributes of the new node attributes, Object the value of the new node value)Creates a new node as a child of the current node. |
| private void | |
| public Object | |
| public Map | Returns: the attributes of the nodeReturns a |
| public List | Returns: the list of (breadth-first) ordered nodesProvides a collection of all the nodes in the tree using a breadth-first preorder traversal. |
| public List | Returns: the list of (breadth-first) ordered nodesif false, a postorder breadth-first traversal will be performed preorder)Provides a collection of all the nodes in the tree using a breadth-first traversal. |
| public void | breadthFirst(Closure<V>
the closure to run for each node (a one or two parameter can be used; if one parameter is given the
closure will be passed the node, for a two param closure the second parameter will be the level). c)Calls the provided closure for all the nodes in the tree using a breadth-first preorder traversal. |
| public void | breadthFirst(Map<String, Object>
map containing options options, Closure<V> the closure to run for each node (a one or two parameter can be used; if one parameter is given the
closure will be passed the node, for a two param closure the second parameter will be the level). c)Calls the provided closure for all the nodes in the tree using a breadth-first traversal. |
| private List | |
| private void | |
| private static List | |
| private static <T> T | |
| public List | |
| public Object | Returns: the cloneOverrides java. |
| public List | Returns: the list of (depth-first) ordered nodesProvides a collection of all the nodes in the tree using a depth-first preorder traversal. |
| public List | Returns: the list of (depth-first) ordered nodesif false, a postorder depth-first traversal will be performed preorder)Provides a collection of all the nodes in the tree using a depth-first traversal. |
| public void | depthFirst(Closure<V>
the closure to run for each node (a one or two parameter can be used; if one parameter is given the
closure will be passed the node, for a two param closure the second parameter will be the level). c)Provides a collection of all the nodes in the tree using a depth-first preorder traversal. |
| public void | depthFirst(Map<String, Object>
map containing options options, Closure<V> the closure to run for each node (a one or two parameter can be used; if one parameter is given the
closure will be passed the node, for a two param closure the second parameter will be the level). c)Provides a collection of all the nodes in the tree using a depth-first traversal. |
| private List | |
| private void | |
| public Object | |
| public NodeList | |
| public NodeList | Returns: the nodes matching namethe QName of interest name)
Deprecated
use
Provides lookup of elements by QName.
getAt(groovy. instead
|
| private NodeList | |
| private List | |
| private static List | |
| private List | |
| public Iterator | Returns: the iterator of the nodes childrenReturns an |
| public List | Returns: the list of String values from this nodeReturns the list of any direct String nodes of this node. |
| public Object | Returns: the name ornull if name is emptyReturns an |
| public Node | |
| public void | |
| public void | |
| public boolean | |
| public Node | Returns: the original now replaced nodeA Closure defining the new nodes using builder-style notation. c)Replaces the current node with nodes defined using builder-style notation via a Closure. |
| public Node | Returns: the original now replaced nodethe new Node n)Replaces the current node with the supplied node. |
| protected static void | setMetaClass(final MetaClass
the original metaclass metaClass, Class<T> the class whose metaclass we wish to override (this class or a subclass) nodeClass)Extension point for subclasses to override the metaclass. |
| protected void | |
| public void | |
| public String | Returns: the text value of the node including child textReturns the textual representation of the current node and all its child nodes. |
| private boolean | |
| public BigDecimal | Returns: the GPathResult, converted to aBigDecimalConverts the text of this GPathResult to a BigDecimal object. |
| public BigInteger | Returns: the GPathResult, converted to aBigIntegerConverts the text of this GPathResult to a BigInteger object. |
| public Double | Returns: the GPathResult, converted to aDoubleConverts the text of this GPathResult to a Double object. |
| public Float | Returns: the GPathResult, converted to aFloatConverts the text of this GPathResult to a Float object. |
| public Integer | Returns: the GPathResult, converted to aIntegerConverts the text of this GPathResult to a Integer object. |
| public Long | Returns: the GPathResult, converted to aLongConverts the text of this GPathResult to a Long object. |
| public String | |
| public Object | Returns: the value ornull if value is emptyReturns an |
| attributes | back to summary |
|---|---|
| private final Map<K, V> attributes | |
| name | back to summary |
|---|---|
| private final Object name | |
| parent | back to summary |
|---|---|
| private Node parent | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| value | back to summary |
|---|---|
| private Object value | |
| Node | back to summary |
|---|---|
| public Node(Node parent, Object name) Creates a new Node named | |
| Node | back to summary |
|---|---|
| public Node(Node parent, Object name, Object value) Creates a new Node named | |
| Node | back to summary |
|---|---|
| public Node(Node parent, Object name, Map<K, V> attributes) Creates a new Node named | |
| Node | back to summary |
|---|---|
| public Node(Node parent, Object name, Map<K, V> attributes, Object value) Creates a new Node named | |
| append | back to summary |
|---|---|
| public boolean append(Node child) Appends a child to the current node.
| |
| appendNode | back to summary |
|---|---|
| public Node appendNode(Object name, Map<K, V> attributes) Creates a new node as a child of the current node. | |
| appendNode | back to summary |
|---|---|
| public Node appendNode(Object name) Creates a new node as a child of the current node. | |
| appendNode | back to summary |
|---|---|
| public Node appendNode(Object name, Object value) Creates a new node as a child of the current node. | |
| appendNode | back to summary |
|---|---|
| public Node appendNode(Object name, Map<K, V> attributes, Object value) Creates a new node as a child of the current node. | |
| appendNodes | back to summary |
|---|---|
| private void appendNodes(Closure<V> c) | |
| attribute | back to summary |
|---|---|
| public Object attribute(Object key) Provides lookup of attributes by key. | |
| attributes | back to summary |
|---|---|
| public Map Returns a
| |
| breadthFirst | back to summary |
|---|---|
| public List Provides a collection of all the nodes in the tree using a breadth-first preorder traversal.
| |
| breadthFirst | back to summary |
|---|---|
| public List Provides a collection of all the nodes in the tree using a breadth-first traversal.
| |
| breadthFirst | back to summary |
|---|---|
| public void breadthFirst(Closure<V> c) Calls the provided closure for all the nodes in the tree using a breadth-first preorder traversal.
| |
| breadthFirst | back to summary |
|---|---|
| public void breadthFirst(Map<String, Object> options, Closure<V> c) Calls the provided closure for all the nodes in the tree using a breadth-first traversal. A boolean 'preorder' options is supported. | |
| breadthFirstRest | back to summary |
|---|---|
| private List | |
| breadthFirstRest | back to summary |
|---|---|
| private void breadthFirstRest(boolean preorder, int level, Closure<V> c) | |
| buildChildrenFromClosure | back to summary |
|---|---|
| private static List | |
| callClosureForNode | back to summary |
|---|---|
| private static <T> T callClosureForNode(Closure<T> closure, Object node, int level) | |
| children | back to summary |
|---|---|
| public List Returns a
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Creates a new Node with the same name, no parent, shallow cloned attributes and if the value is a NodeList, a (deep) clone of those nodes. | |
| depthFirst | back to summary |
|---|---|
| public List Provides a collection of all the nodes in the tree using a depth-first preorder traversal.
| |
| depthFirst | back to summary |
|---|---|
| public List Provides a collection of all the nodes in the tree using a depth-first traversal.
| |
| depthFirst | back to summary |
|---|---|
| public void depthFirst(Closure<V> c) Provides a collection of all the nodes in the tree using a depth-first preorder traversal.
| |
| depthFirst | back to summary |
|---|---|
| public void depthFirst(Map<String, Object> options, Closure<V> c) Provides a collection of all the nodes in the tree using a depth-first traversal. A boolean 'preorder' options is supported. | |
| depthFirstRest | back to summary |
|---|---|
| private List | |
| depthFirstRest | back to summary |
|---|---|
| private void depthFirstRest(boolean preorder, int level, Closure<V> c) | |
| get | back to summary |
|---|---|
| public Object get(String key) Provides lookup of elements by non-namespaced name | |
| getAt | back to summary |
|---|---|
| public NodeList getAt(QName name) Provides lookup of elements by QName. | |
| getAt | back to summary |
|---|---|
| public NodeList getAt(QName name)
Deprecated use Provides lookup of elements by QName. | |
| getByName | back to summary |
|---|---|
| private NodeList getByName(String name) Provides lookup of elements by name. | |
| getDirectChildren | back to summary |
|---|---|
| private List | |
| getParentList | back to summary |
|---|---|
| private static List | |
| getTail | back to summary |
|---|---|
| private List | |
| iterator | back to summary |
|---|---|
| public Iterator Returns an
| |
| localText | back to summary |
|---|---|
| public List Returns the list of any direct String nodes of this node. | |
| name | back to summary |
|---|---|
| public Object name() Returns an
| |
| parent | back to summary |
|---|---|
| public Node parent() Returns the parent of the node.
| |
| plus | back to summary |
|---|---|
| public void plus(Closure<V> c) Adds sibling nodes (defined using builder-style notation via a Closure) after the current node.
| |
| back to summary | |
|---|---|
| public void print(PrintWriter out) Writes the node to the specified
| |
| remove | back to summary |
|---|---|
| public boolean remove(Node child) Removes a child of the current node.
| |
| replaceNode | back to summary |
|---|---|
| public Node replaceNode(Closure<V> c) Replaces the current node with nodes defined using builder-style notation via a Closure. | |
| replaceNode | back to summary |
|---|---|
| public Node replaceNode(Node n) Replaces the current node with the supplied node. | |
| setMetaClass | back to summary |
|---|---|
| protected static void setMetaClass(final MetaClass metaClass, Class<T> nodeClass) Extension point for subclasses to override the metaclass. The default one supports the property and @ attribute notations. | |
| setParent | back to summary |
|---|---|
| protected void setParent(Node parent) Adds or replaces the parent of the node.
| |
| setValue | back to summary |
|---|---|
| public void setValue(Object value) Adds or replaces the value of the node.
| |
| text | back to summary |
|---|---|
| public String text() Returns the textual representation of the current node and all its child nodes.
| |
| textIsEmptyOrNull | back to summary |
|---|---|
| private boolean textIsEmptyOrNull() | |
| toBigDecimal | back to summary |
|---|---|
| public BigDecimal toBigDecimal() Converts the text of this GPathResult to a BigDecimal object.
| |
| toBigInteger | back to summary |
|---|---|
| public BigInteger toBigInteger() Converts the text of this GPathResult to a BigInteger object.
| |
| toDouble | back to summary |
|---|---|
| public Double toDouble() Converts the text of this GPathResult to a Double object.
| |
| toFloat | back to summary |
|---|---|
| public Float toFloat() Converts the text of this GPathResult to a Float object.
| |
| toInteger | back to summary |
|---|---|
| public Integer toInteger() Converts the text of this GPathResult to a Integer object.
| |
| toLong | back to summary |
|---|---|
| public Long toLong() Converts the text of this GPathResult to a Long object.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |
| value | back to summary |
|---|---|
| public Object value() Returns an
| |