org.picocontainer.script.groovy
Interface BuilderNode

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

public interface BuilderNode

In a 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 node builder to figure out who should handle what.

Author:
Michael Rimov

Method Summary
 Object createNewNode(Object current, Map<String,Object> attributes)
          Creates a new node .
 String getNodeName()
          Returns the name of the node, eg 'container' or 'component'.
 Set<String> getSupportedAttributeNames()
          Returns the supported attribute names.
 void validateScriptedAttributes(Map<String,Object> attributes)
          Validates a the attributes as supplied by the node builder against the node's supported attributes.
 

Method Detail

getNodeName

String getNodeName()
Returns the name of the node, eg 'container' or 'component'.

Returns:
The node name

getSupportedAttributeNames

Set<String> getSupportedAttributeNames()
Returns the supported attribute names.

Returns:
The Set of supported attribute names.

validateScriptedAttributes

void validateScriptedAttributes(Map<String,Object> attributes)
                                throws ScriptedPicoContainerMarkupException
Validates a the attributes as supplied by the node builder against the node's supported attributes.

Parameters:
attributes - the Map of scripted attributes
Throws:
ScriptedPicoContainerMarkupException

createNewNode

Object createNewNode(Object current,
                     Map<String,Object> attributes)
                     throws ScriptedPicoContainerMarkupException
Creates a new node .

Parameters:
current - the current Object - may be null for no parent container.
attributes - the Map of scripted attributes for the builder node - may be null
Returns:
The newly created node
Throws:
ScriptedPicoContainerMarkupException - upon script failure to create new node.


Copyright © 2003-2010 Codehaus. All Rights Reserved.