| java.lang.Object groovy.util.Node
Node | public class Node implements java.io.Serializable(Code) | | Represents an arbitrary tree node which can be used for structured metadata or any arbitrary XML-like tree.
A node can have a name, a value and an optional Map of attributes.
Typically the name is a String and a value is either a String or a List of other Nodes,
though the types are extensible to provide a flexible structure, e.g. you could use a
QName as the name which includes a namespace URI and a local name. Or a JMX ObjectName etc.
So this class can represent metadata like {foo a=1 b="abc"} or nested metadata like {foo a=1 b="123" { bar x=12 text="hello" }}
author: James Strachan version: $Revision: 4201 $ |
breadthFirst | public List breadthFirst()(Code) | | Provide a collection of all the nodes in the tree
using a breadth-first traversal.
the list of (breadth-first) ordered nodes |
depthFirst | public List depthFirst()(Code) | | Provide a collection of all the nodes in the tree
using a depth first traversal.
the list of (depth-first) ordered nodes |
get | public Object get(String key)(Code) | | Provides lookup of elements by non-namespaced name
Parameters: key - the name (or shortcut key) of the node(s) of interest the nodes which match key |
getAt | public NodeList getAt(QName name)(Code) | | Provides lookup of elements by QName.
Parameters: name - the QName of interest the nodes matching name |
|
|