1 6 7 package org.jfox.ioc.deploy; 8 9 import java.util.ArrayList ; 10 import java.util.Iterator ; 11 import java.util.List ; 12 13 import org.jfox.ioc.deployment.Descriptor; 14 import org.jfox.ioc.util.XMLUtils; 15 import org.w3c.dom.Element ; 16 import org.w3c.dom.Node ; 17 18 21 22 public class ConstructorDescriptor implements Descriptor { 23 private List params = new ArrayList (); 24 25 public void processXML(Node node) throws ComponentDescriptionException { 26 Iterator paramDescriptors = XMLUtils.getElementsByTagName((Element ) node, "param"); 27 while(paramDescriptors.hasNext()) { 28 Element paramElement = (Element ) paramDescriptors.next(); 29 ParameterDescriptor pd = new ParameterDescriptor(); 30 pd.processXML(paramElement); 31 addParamDescriptor(pd); 32 } 33 } 34 35 private void addParamDescriptor(ParameterDescriptor pd) { 36 params.add(pd); 37 } 38 39 public ParameterDescriptor[] getParamDescriptors() { 40 return (ParameterDescriptor[]) params.toArray(new ParameterDescriptor[params.size()]); 41 } 42 43 public static void main(String [] args) { 44 45 } 46 47 } 48 49 | Popular Tags |