KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > api > jaxws > wsdlmodel > WsdlParameter


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.api.jaxws.wsdlmodel;
21
22 import com.sun.tools.ws.processor.model.java.JavaParameter;
23
24 /**
25  *
26  * @author mkuchtiak
27  */

28 public class WsdlParameter {
29     private JavaParameter parameter;
30     /** Creates a new instance of WsdlParameter */
31     public WsdlParameter(JavaParameter parameter) {
32         this.parameter=parameter;
33     }
34     
35     public Object JavaDoc /*com.sun.tools.ws.processor.model.Operation*/ getInternalJAXWSParameter() {
36         return parameter;
37     }
38     
39     public String JavaDoc getName() {
40         return parameter.getName();
41     }
42     
43     public String JavaDoc getTypeName() {
44         String JavaDoc type = parameter.getType().getName();
45         return isHolder()?"javax.xml.ws.Holder<"+wrapperType(type)+">":type;//NOI18N
46
}
47     
48     public boolean isHolder() {
49         return parameter.isHolder();
50     }
51     
52     public String JavaDoc getHolderName() {
53         return parameter.getHolderName();
54     }
55     
56     private String JavaDoc wrapperType(String JavaDoc type) {
57         if ("int".equals(type)) return "Integer"; //NOI18N
58
else if ("float".equals(type)) return "Float"; //NOI18N
59
else if ("double".equals(type)) return "Double"; //NOI18N
60
else if ("byte".equals(type)) return "Byte"; //NOI18N
61
else if ("long".equals(type)) return "Long"; //NOI18N
62
else if ("boolean".equals(type)) return "Boolean"; //NOI18N
63
else if ("char".equals(type)) return "Character"; //NOI18N
64
else return type;
65     }
66 }
67
Popular Tags