Package: groovy.util

## [Java] Class NodeBuilder

- groovy.util.NodeBuilder

-     public class NodeBuilder
      extends BuilderSupport

  A helper class for creating nested trees of Node objects for handling arbitrary data

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected Object` | `createNode(Object name)` Creates a node with the given name. Parameters: `name` - the node name Returns: the created node
    `` | `protected Object` | `createNode(Object name, Object value)` Creates a node with the given name and value. Parameters: `name` - the node name `value` - the node value Returns: the created node
    `` | `protected Object` | `createNode(Object name, Map attributes)` Creates a node with the given name and attributes. Parameters: `name` - the node name `attributes` - the node attributes Returns: the created node
    `` | `protected Object` | `createNode(Object name, Map attributes, Object value)` Creates a node with the given name, attributes, and value. Parameters: `name` - the node name `attributes` - the node attributes `value` - the node value Returns: the created node
    `` | `protected Node` | `getCurrentNode()` Returns the current node being built.
    `` | `public static NodeBuilder` | `newInstance()` Creates a new `NodeBuilder`.
    `` | `protected void` | `setParent(Object parent, Object child)` Links a newly created child node to its parent. Parameters: `parent` - the parent node `child` - the child node

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class BuilderSupport` | `createNode, createNode, createNode, createNode, doInvokeMethod, getCurrent, getName, invokeMethod, invokeMethod, nodeCompleted, postNodeCompletion, setClosureDelegate, setCurrent, setParent`
    `class GroovyObjectSupport` | `getMetaClass, setMetaClass`

- - ### Method Detail

    - #### protected Object createNode(Object name)

      Creates a node with the given name.

      Parameters:
        `name` - the node name
      Returns:
        the created node

    - #### protected Object createNode(Object name, Object value)

      Creates a node with the given name and value.

      Parameters:
        `name` - the node name
        `value` - the node value
      Returns:
        the created node

    - #### protected Object createNode(Object name, Map attributes)

      Creates a node with the given name and attributes.

      Parameters:
        `name` - the node name
        `attributes` - the node attributes
      Returns:
        the created node

    - #### protected Object createNode(Object name, Map attributes, Object value)

      Creates a node with the given name, attributes, and value.

      Parameters:
        `name` - the node name
        `attributes` - the node attributes
        `value` - the node value
      Returns:
        the created node

    - #### protected Node getCurrentNode()

      Returns the current node being built.

      Returns:
        the current node, or `null` if none is active

    - #### public static NodeBuilder newInstance()

      Creates a new `NodeBuilder`.

      Returns:
        a new builder instance

    - #### protected void setParent(Object parent, Object child)

      Links a newly created child node to its parent.

      Parameters:
        `parent` - the parent node
        `child` - the child node