1 10 11 package org.nanocontainer.script.groovy; 12 13 import groovy.util.NodeBuilder; 14 import org.picocontainer.MutablePicoContainer; 15 16 import java.util.Map ; 17 18 22 public class TestingChildBuilder extends NodeBuilder { 23 24 MutablePicoContainer toOperateOn; 25 26 public TestingChildBuilder(MutablePicoContainer toOperateOn) { 27 this.toOperateOn = toOperateOn; 28 } 29 30 protected Object createNode(Object name, Map map) { 31 if (name.equals("component")) { 32 return toOperateOn.registerComponentImplementation(map.remove("key"), (Class ) map.remove("class")); 33 } else { 34 return null; 35 } 36 } 37 38 } 39 | Popular Tags |