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 PropertyDescriptor implements Descriptor { 23 private List params = new ArrayList (); 24 private String name = ""; 25 26 public void processXML(Node node) throws ComponentDescriptionException { 27 setName(XMLUtils.getAtrributeValueOf(node, "name")); 28 Iterator paramDescriptors = XMLUtils.getElementsByTagName((Element ) node, "param"); 29 while(paramDescriptors.hasNext()) { 30 Element paramElement = (Element ) paramDescriptors.next(); 31 ParameterDescriptor pd = new ParameterDescriptor(); 32 pd.processXML(paramElement); 33 addParamDescriptor(pd); 34 } 35 } 36 37 private void addParamDescriptor(ParameterDescriptor pd) { 38 params.add(pd); 39 } 40 41 public ParameterDescriptor[] getParamDescriptors() { 42 return (ParameterDescriptor[]) params.toArray(new ParameterDescriptor[params.size()]); 43 } 44 45 public String getName() { 46 return name; 47 } 48 49 public void setName(String name) { 50 this.name = name; 51 } 52 53 public static void main(String [] args) { 54 55 } 56 } 57 58 | Popular Tags |