001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.websvc.registry.model;
043:
044: import com.sun.xml.rpc.processor.model.Port;
045: import com.sun.xml.rpc.processor.model.Operation;
046: import com.sun.xml.rpc.processor.model.java.JavaMethod;
047:
048: import java.util.ArrayList;
049: import java.util.Iterator;
050:
051: /**
052: * This class is meant to hold the pertinent data from the class
053: * com.sun.xml.rpc.processor.model.Port. This class will serve as a
054: * JavaBean. This class will be persisted with the WebServiceData.
055: * @author David Botterill
056: */
057: public class WSPort {
058:
059: private String name;
060: private String address;
061: private String javaInterfaceName;
062: private ArrayList methods = new ArrayList();
063:
064: /** Creates a new instance of WSPort */
065: public WSPort() {
066: }
067:
068: public WSPort(Port inPort) {
069: if (null == inPort)
070: return;
071: this .address = inPort.getAddress();
072: this .javaInterfaceName = inPort.getJavaInterface()
073: .getRealName();
074: this .name = inPort.getName().getLocalPart();
075: Iterator opIter = inPort.getOperations();
076: while (opIter.hasNext()) {
077: JavaMethod javaMethod = (JavaMethod) ((Operation) opIter
078: .next()).getJavaMethod();
079: this .addMethod(javaMethod);
080: }
081:
082: }
083:
084: /**
085: * Getter for property name.
086: * @return Value of property name.
087: */
088: public java.lang.String getName() {
089: return name;
090: }
091:
092: /**
093: * Setter for property name.
094: * @param name New value of property name.
095: */
096: public void setName(java.lang.String name) {
097: this .name = name;
098: }
099:
100: /**
101: * Getter for property address.
102: * @return Value of property address.
103: */
104: public java.lang.String getAddress() {
105: return address;
106: }
107:
108: /**
109: * Setter for property address.
110: * @param address New value of property address.
111: */
112: public void setAddress(java.lang.String address) {
113: this .address = address;
114: }
115:
116: /**
117: * Getter for property javaInterfaceName.
118: * @return Value of property javaInterfaceName.
119: */
120: public java.lang.String getJavaInterfaceName() {
121: return javaInterfaceName;
122: }
123:
124: /**
125: * Setter for property javaInterfaceName.
126: * @param javaInterfaceName New value of property javaInterfaceName.
127: */
128: public void setJavaInterfaceName(java.lang.String javaInterfaceName) {
129: this .javaInterfaceName = javaInterfaceName;
130: }
131:
132: public void addMethod(JavaMethod inMethod) {
133: methods.add(inMethod);
134: }
135:
136: /**
137: * Getter for property methods.
138: * @return Value of property methods.
139: */
140: public java.util.ArrayList getMethods() {
141: return methods;
142: }
143:
144: /**
145: * Setter for property methods.
146: * @param methods New value of property methods.
147: */
148: public void setMethods(java.util.ArrayList methods) {
149: this.methods = methods;
150: }
151:
152: }
|