org.nanocontainer.script.groovy
Interface BuilderNode

All Known Implementing Classes:
AbstractBuilderNode, AppendContainerNode, BeanNode, ChildContainerNode, ClassLoaderNode, ClasspathNode, ComponentNode, DecoratingPicoContainerNode, DoCallNode, GrantNode, NewBuilderNode

public interface BuilderNode

In a groovy node builder environment, there is often one class per node that is possible in a builder. This interface provides the necessary validation and interaction methods for the mediator (The GroovyNodeBuilder object) to figure out who should handle what.

Version:
1.0
Author:
Michael Rimov

Method Summary
 java.lang.Object createNewNode(java.lang.Object current, java.util.Map attributes)
          Execute the handler for the given node builder.
 java.lang.String getNodeName()
          Retrieve the name of the node.
 java.util.Set getSupportedAttributes()
          Retrieve a map of supported attribute names.
 void validateScriptedAttributes(java.util.Map specifiedAttributes)
          Validates a given map of attributes as supplied by the GroovyNodeBuilder against the node's supported attributes.
 

Method Detail

getNodeName

java.lang.String getNodeName()
Retrieve the name of the node. Examples could be 'container' or 'component'.

Returns:
String

getSupportedAttributes

java.util.Set getSupportedAttributes()
Retrieve a map of supported attribute names.

note:Supported attributes are currently unverified by the GroovyNodeBuilder as this would result in a change of behavior.

Returns:
Set of Strings.

validateScriptedAttributes

void validateScriptedAttributes(java.util.Map specifiedAttributes)
                                throws org.nanocontainer.script.NanoContainerMarkupException
Validates a given map of attributes as supplied by the GroovyNodeBuilder against the node's supported attributes.

Parameters:
specifiedAttributes - Map
Throws:
org.nanocontainer.script.NanoContainerMarkupException

createNewNode

java.lang.Object createNewNode(java.lang.Object current,
                               java.util.Map attributes)
                               throws org.nanocontainer.script.NanoContainerMarkupException
Execute the handler for the given node builder.

Parameters:
current - the current object. May be null for no parent container.
attributes - Map attributes specified in the groovy script for the builder node. in for consistency with the Groovy Builder API. Normally set to null.
Returns:
Object
Throws:
org.nanocontainer.script.NanoContainerMarkupException - upon Nanocontainer error.


Copyright © 2003-2009 Codehaus. All Rights Reserved.