|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.nanocontainer.script.groovy.buildernodes.AbstractBuilderNode
org.nanocontainer.script.groovy.buildernodes.AppendContainerNode
public class AppendContainerNode
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(....)
//...
}
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 |
---|
public static final String NODE_NAME
public static final String CONTAINER
Constructor Detail |
---|
public AppendContainerNode()
Method Detail |
---|
public Object createNewNode(Object current, Map attributes) throws org.nanocontainer.script.NanoContainerMarkupException, ClassCastException
current
- Object unused.attributes
- Map attributes passed in. This must have the container
attribute defined.
org.nanocontainer.script.NanoContainerMarkupException
- if the container attribute
is not supplied.
ClassCastException
- if the container node specified is not
a nano or picocontainer.
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |