Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.nanocontainer.script.groovy.buildernodes
Class AppendContainerNode

    java.lang.Object
      org.nanocontainer.script.groovy.buildernodes.AbstractBuilderNode
          org.nanocontainer.script.groovy.buildernodes.AppendContainerNode

All Implemented Interfaces:
  Serializable, BuilderNode

    public class AppendContainerNode

extends AbstractBuilderNode

Sometimes it is worthwhile to split apart Nanocontainer building into functions. For example, you might want to group adding the domain object repositories (DAOs) into a single function to make your composition script easier to maintain.

Unfortunately, normally this is not allowed under normal builder rules. If you wish to separate code you must revert to standard picocontainer calling systax.

This node corrects that deficiency.

With it you can perform: ``

     pico = builder.container(parent:parent) {
       component(....)
       //...
     }

     //Now add more to pico.
     builder.append(container: pico) {
       component(....)
       //...
     }

Version:
  1.0
Author:
  Michael Rimov
See Also:
  Serialized Form

Field Summary
`static String` | `CONTAINER` Supported Attribute (Required): 'container.' Reference to the container we are going to append to.
`static String` | `NODE_NAME` Node name.

Constructor Summary
`AppendContainerNode()` Constructs an append container node.

Method Summary
`Object` | `createNewNode(Object current, Map attributes)` Returns the container passed in as the "container" attribute.

Methods inherited from class org.nanocontainer.script.groovy.buildernodes.AbstractBuilderNode
`addAttribute, getNodeName, getSupportedAttributes, isAttribute, toString, validateScriptedAttributes`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### NODE_NAME

    public static final String NODE_NAME

  Node name.

  See Also:
    Constant Field Values

### CONTAINER

    public static final String CONTAINER

  Supported Attribute (Required): 'container.' Reference to the container we are going to append to.

  See Also:
    Constant Field Values

Constructor Detail

### AppendContainerNode

    public AppendContainerNode()

  Constructs an append container node.

Method Detail

### createNewNode

    public Object createNewNode(Object current,
                                Map attributes)
                         throws org.nanocontainer.script.NanoContainerMarkupException,
                                ClassCastException

  Returns the container passed in as the "container" attribute.

  Parameters:
    `current` - Object unused.
    `attributes` - Map attributes passed in. This must have the container attribute defined.
  Returns:
    Object the passed in Nanocontainer.
  Throws:
    `org.nanocontainer.script.NanoContainerMarkupException` - if the container attribute is not supplied.
    `ClassCastException` - if the container node specified is not a nano or picocontainer.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2007 Codehaus. All Rights Reserved.