KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > registry > model > WSPort


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.websvc.registry.model;
21
22 import com.sun.xml.rpc.processor.model.Port;
23 import com.sun.xml.rpc.processor.model.Operation;
24 import com.sun.xml.rpc.processor.model.java.JavaMethod;
25
26 import java.util.ArrayList JavaDoc;
27 import java.util.Iterator JavaDoc;
28
29 /**
30  * This class is meant to hold the pertinent data from the class
31  * com.sun.xml.rpc.processor.model.Port. This class will serve as a
32  * JavaBean. This class will be persisted with the WebServiceData.
33  * @author David Botterill
34  */

35 public class WSPort {
36
37     private String JavaDoc name;
38     private String JavaDoc address;
39     private String JavaDoc javaInterfaceName;
40     private ArrayList JavaDoc methods = new ArrayList JavaDoc();
41     
42     
43     /** Creates a new instance of WSPort */
44     public WSPort() {
45     }
46     
47     public WSPort(Port inPort) {
48         if(null == inPort) return;
49         this.address = inPort.getAddress();
50         this.javaInterfaceName = inPort.getJavaInterface().getRealName();
51         this.name = inPort.getName().getLocalPart();
52         Iterator JavaDoc opIter = inPort.getOperations();
53         while(opIter.hasNext()){
54             JavaMethod javaMethod = (JavaMethod)((Operation)opIter.next()).getJavaMethod();
55             this.addMethod(javaMethod);
56         }
57         
58     }
59     
60     /**
61      * Getter for property name.
62      * @return Value of property name.
63      */

64     public java.lang.String JavaDoc getName() {
65         return name;
66     }
67     
68     /**
69      * Setter for property name.
70      * @param name New value of property name.
71      */

72     public void setName(java.lang.String JavaDoc name) {
73         this.name = name;
74     }
75     
76     /**
77      * Getter for property address.
78      * @return Value of property address.
79      */

80     public java.lang.String JavaDoc getAddress() {
81         return address;
82     }
83     
84     /**
85      * Setter for property address.
86      * @param address New value of property address.
87      */

88     public void setAddress(java.lang.String JavaDoc address) {
89         this.address = address;
90     }
91     
92     /**
93      * Getter for property javaInterfaceName.
94      * @return Value of property javaInterfaceName.
95      */

96     public java.lang.String JavaDoc getJavaInterfaceName() {
97         return javaInterfaceName;
98     }
99     
100     /**
101      * Setter for property javaInterfaceName.
102      * @param javaInterfaceName New value of property javaInterfaceName.
103      */

104     public void setJavaInterfaceName(java.lang.String JavaDoc javaInterfaceName) {
105         this.javaInterfaceName = javaInterfaceName;
106     }
107     
108     public void addMethod(JavaMethod inMethod) {
109         methods.add(inMethod);
110     }
111     /**
112      * Getter for property methods.
113      * @return Value of property methods.
114      */

115     public java.util.ArrayList JavaDoc getMethods() {
116         return methods;
117     }
118     
119     /**
120      * Setter for property methods.
121      * @param methods New value of property methods.
122      */

123     public void setMethods(java.util.ArrayList JavaDoc methods) {
124         this.methods = methods;
125     }
126     
127 }
128
Popular Tags