KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nanocontainer > script > groovy > BuilderNode


1 package org.nanocontainer.script.groovy;
2
3 import java.util.Map JavaDoc;
4 import java.util.Set JavaDoc;
5 import org.nanocontainer.script.NanoContainerMarkupException;
6
7 /**
8  * In a groovy node builder environment, there is often one class per
9  * node that is possible in a builder. This interface provides the necessary
10  * validation and interaction methods for the mediator (The GroovyNodeBuilder
11  * object) to figure out who should handle what.
12  * @author Michael Rimov
13  * @version 1.0
14  */

15 public interface BuilderNode {
16
17     /**
18      * Retrieve the name of the node. Examples could be 'container' or 'component'.
19      * @return String
20      */

21     String JavaDoc getNodeName();
22
23     /**
24      * Retrieve a map of supported attribute names.
25      * <p><strong>note:</strong>Supported attributes are currently unverified by the
26      * GroovyNodeBuilder as this would result in a change of behavior.</p>
27      * @return Set of Strings.
28      */

29     Set JavaDoc getSupportedAttributes();
30
31
32     /**
33      * Validates a given map of attributes as supplied by the GroovyNodeBuilder
34      * against the node's supported attributes.
35      * @param specifiedAttributes Map
36      * @throws NanoContainerMarkupException
37      */

38     void validateScriptedAttributes(Map JavaDoc specifiedAttributes) throws NanoContainerMarkupException;
39
40     /**
41      * Execute the handler for the given node builder.
42      * @param current the current object. May be null
43      * for no parent container.
44      * @param attributes Map attributes specified in the groovy script
45      * for the builder node.
46      * in for consistency with the Groovy Builder API. Normally set to null.
47      * @return Object
48      * @throws NanoContainerMarkupException upon Nanocontainer error.
49      */

50     Object JavaDoc createNewNode(Object JavaDoc current, Map JavaDoc attributes) throws NanoContainerMarkupException;
51 }
52
Popular Tags