KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > ioc > deploy > ConstructorDescriptor


1 /* JFox, the OpenSource J2EE Application Server
2  *
3  * Distributable under GNU LGPL license by gun.org
4  * more details please visit http://www.huihoo.org/jfox
5  */

6
7 package org.jfox.ioc.deploy;
8
9 import java.util.ArrayList JavaDoc;
10 import java.util.Iterator JavaDoc;
11 import java.util.List JavaDoc;
12
13 import org.jfox.ioc.deployment.Descriptor;
14 import org.jfox.ioc.util.XMLUtils;
15 import org.w3c.dom.Element JavaDoc;
16 import org.w3c.dom.Node JavaDoc;
17
18 /**
19  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
20  */

21
22 public class ConstructorDescriptor implements Descriptor {
23     private List JavaDoc params = new ArrayList JavaDoc();
24
25     public void processXML(Node JavaDoc node) throws ComponentDescriptionException {
26         Iterator JavaDoc paramDescriptors = XMLUtils.getElementsByTagName((Element JavaDoc) node, "param");
27         while(paramDescriptors.hasNext()) {
28             Element JavaDoc paramElement = (Element JavaDoc) 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 JavaDoc[] args) {
44
45     }
46
47 }
48
49
Popular Tags