001    /*******************************************************************************
002     * Copyright (C) PicoContainer Organization. All rights reserved.
003     * ---------------------------------------------------------------------------
004     * The software in this package is published under the terms of the BSD style
005     * license a copy of which has been included with this distribution in the
006     * LICENSE.txt file.
007     ******************************************************************************/
008    package org.picocontainer.script;
009    
010    import org.picocontainer.MutablePicoContainer;
011    import org.picocontainer.ComponentFactory;
012    
013    import java.util.Map;
014    
015    /**
016     * NodeBuilderDecorators allows to dynamically extend node-based builder syntax,
017     * such as
018     * {@link org.picocontainer.script.groovy.GroovyNodeBuilder GroovyNodeBuilder}.
019     * 
020     * @author Paul Hammant
021     * @author Aslak Hellesøy
022     */
023    @SuppressWarnings("unchecked")
024    public interface NodeBuilderDecorator {
025    
026        ComponentFactory decorate(ComponentFactory componentFactory, Map attributes);
027    
028        MutablePicoContainer decorate(MutablePicoContainer picoContainer);
029    
030        Object createNode(Object name, Map attributes, Object parentElement);
031    
032        void rememberComponentKey(Map attributes);
033    
034    }