Source Code Cross Referenced for ParameterDescriptionComposite.java in  » Web-Services-AXIS2 » metadata » org » apache » axis2 » jaxws » description » builder » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Services AXIS2 » metadata » org.apache.axis2.jaxws.description.builder 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one
003:         * or more contributor license agreements. See the NOTICE file
004:         * distributed with this work for additional information
005:         * regarding copyright ownership. The ASF licenses this file
006:         * to you under the Apache License, Version 2.0 (the
007:         * "License"); you may not use this file except in compliance
008:         * with the License. You may obtain a copy of the License at
009:         *
010:         * http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing,
013:         * software distributed under the License is distributed on an
014:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015:         * KIND, either express or implied. See the License for the
016:         * specific language governing permissions and limitations
017:         * under the License.
018:         */
019:
020:        /**
021:         * 
022:         */package org.apache.axis2.jaxws.description.builder;
023:
024:        public class ParameterDescriptionComposite {
025:            private String parameterType;
026:            private Class parameterTypeClass;
027:            private WebParamAnnot webParamAnnot;
028:            private WebServiceRefAnnot webServiceRefAnnot;
029:            private WebServiceContextAnnot webServiceContextAnnot;
030:            private int listOrder;
031:            // Will indicate whether or not we found an @XMLList annotation on the parameter
032:            private boolean isListType;
033:
034:            private MethodDescriptionComposite parentMDC;
035:
036:            public ParameterDescriptionComposite() {
037:
038:            }
039:
040:            public ParameterDescriptionComposite(String parameterType,
041:                    Class parameterTypeClass, WebParamAnnot webParamAnnot,
042:                    WebServiceRefAnnot webServiceRefAnnot,
043:                    WebServiceContextAnnot webServiceContextAnnot) {
044:
045:                this .parameterType = parameterType;
046:                this .parameterTypeClass = parameterTypeClass;
047:                this .webParamAnnot = webParamAnnot;
048:                this .webServiceRefAnnot = webServiceRefAnnot;
049:                this .webServiceContextAnnot = webServiceContextAnnot;
050:            }
051:
052:            /**
053:             * Returns the String descrbing this Parameter type.  Note that this string is unparsed.  For
054:             * example, if it represents a java.util.List<my.package.Foo>, then that excact string will be
055:             * returned, i.e. "java.util.List<my.package.Foo>".  You can use other methods to retrieve parsed
056:             * values for Generics and Holders.  For example, getParameterTypeClass(), getRawType(),
057:             * getHolderActualType(), and getHolderActualTypeClass().
058:             *
059:             * @return Returns the parameterType.
060:             */
061:            public String getParameterType() {
062:                return parameterType;
063:            }
064:
065:            /**
066:             * Returns the class associated with the Parameter.  Note that if this is a generic (including a
067:             * JAXWS Holder<T>) then the class associated with the raw type is returned (i.e. Holder.class).
068:             * <p/>
069:             * For a JAX-WS Holder<T>, use getHolderActualType(...) to get the class associated with T.
070:             *
071:             * @return Returns the parameterTypeClass.
072:             */
073:            public Class getParameterTypeClass() {
074:
075:                if (parameterTypeClass == null) {
076:                    if (getParameterType() != null) {
077:                        parameterTypeClass = DescriptionBuilderUtils
078:                                .getPrimitiveClass(getParameterType());
079:                        if (parameterTypeClass == null) {
080:                            // If this is a Generic, we need to load the class associated with the Raw Type,
081:                            // i.e. for JAX-WS Holder<Foo>, we want to load Holder. Othwerise, load the type directly. 
082:                            String classToLoad = null;
083:                            if (DescriptionBuilderUtils
084:                                    .getRawType(parameterType) != null) {
085:                                classToLoad = DescriptionBuilderUtils
086:                                        .getRawType(parameterType);
087:                            } else {
088:                                classToLoad = parameterType;
089:                            }
090:                            parameterTypeClass = loadClassFromPDC(classToLoad);
091:                        }
092:                    }
093:                }
094:                return parameterTypeClass;
095:            }
096:
097:            /**
098:             * For JAX-WS Holder<T>, returns the class associated with T.  For non-JAX-WS Holders returns
099:             * null.
100:             */
101:            public Class getHolderActualTypeClass() {
102:                Class returnClass = null;
103:
104:                if (DescriptionBuilderUtils.isHolderType(parameterType)) {
105:                    String classToLoad = DescriptionBuilderUtils
106:                            .getHolderActualType(parameterType);
107:                    returnClass = loadClassFromPDC(classToLoad);
108:                }
109:                return returnClass;
110:            }
111:
112:            private Class loadClassFromPDC(String classToLoad) {
113:                Class returnClass = null;
114:                ClassLoader classLoader = null;
115:
116:                if (getMethodDescriptionCompositeRef() != null) {
117:                    if (getMethodDescriptionCompositeRef()
118:                            .getDescriptionBuilderCompositeRef() != null) {
119:                        classLoader = getMethodDescriptionCompositeRef()
120:                                .getDescriptionBuilderCompositeRef()
121:                                .getClassLoader();
122:                    }
123:                }
124:                returnClass = DescriptionBuilderUtils.loadClassFromComposite(
125:                        classToLoad, classLoader);
126:                return returnClass;
127:            }
128:
129:            /** @return Returns the webParamAnnot. */
130:            public WebParamAnnot getWebParamAnnot() {
131:                return webParamAnnot;
132:            }
133:
134:            /** @return Returns the webServiceRefAnnot. */
135:            public WebServiceRefAnnot getWebServiceRefAnnot() {
136:                return webServiceRefAnnot;
137:            }
138:
139:            /** @return Returns the webServiceContextAnnot. */
140:            public WebServiceContextAnnot getWebServiceContextAnnot() {
141:                return webServiceContextAnnot;
142:            }
143:
144:            /** @return Returns the webServiceContextAnnot. */
145:            public int getListOrder() {
146:                return listOrder;
147:            }
148:
149:            /** @return Returns the parentMDC. */
150:            public MethodDescriptionComposite getMethodDescriptionCompositeRef() {
151:                return this .parentMDC;
152:            }
153:
154:            /** @param parameterType The parameterType to set. */
155:            public void setParameterType(String parameterType) {
156:                this .parameterType = parameterType;
157:            }
158:
159:            /** @param parameterTypeClass The parameterTypeClass to set. */
160:            private void setParameterTypeClass(Class parameterTypeClass) {
161:                this .parameterTypeClass = parameterTypeClass;
162:            }
163:
164:            /** @param webParamAnnot The webParamAnnot to set. */
165:            public void setWebParamAnnot(WebParamAnnot webParamAnnot) {
166:                this .webParamAnnot = webParamAnnot;
167:            }
168:
169:            /** @param webServiceRefAnnot The webServiceRefAnnot to set. */
170:            public void setWebServiceRefAnnot(
171:                    WebServiceRefAnnot webServiceRefAnnot) {
172:                this .webServiceRefAnnot = webServiceRefAnnot;
173:            }
174:
175:            /** @param webServiceContextAnnot The webServiceContextAnnot to set. */
176:            public void setWebServiceContextAnnot(
177:                    WebServiceContextAnnot webServiceContextAnnot) {
178:                this .webServiceContextAnnot = webServiceContextAnnot;
179:            }
180:
181:            /** @param webServiceContextAnnot The webServiceContextAnnot to set. */
182:            public void setListOrder(int listOrder) {
183:                this .listOrder = listOrder;
184:            }
185:
186:            /** @param mdc The parent MethodDescriptionComposite to set. */
187:            public void setMethodDescriptionCompositeRef(
188:                    MethodDescriptionComposite mdc) {
189:                this .parentMDC = mdc;
190:            }
191:
192:            public boolean compare(Object obj) {
193:                if (obj instanceof  ParameterDescriptionComposite) {
194:                    ParameterDescriptionComposite pdc = (ParameterDescriptionComposite) obj;
195:                    if (!(this .parameterType.equals(pdc.getParameterType()))) {
196:                        return false;
197:                    }
198:                    return true;
199:                } else {
200:                    return super .equals(obj);
201:                }
202:            }
203:
204:            public void setIsListType(boolean isListType) {
205:                this .isListType = isListType;
206:            }
207:
208:            public boolean isListType() {
209:                return isListType;
210:            }
211:
212:            /** Convenience method for unit testing. We will print all of the data members here. */
213:            public String toString() {
214:                StringBuffer sb = new StringBuffer();
215:                final String newLine = "\n";
216:                final String sameLine = "; ";
217:                sb.append(super .toString());
218:                sb.append(sameLine);
219:                sb.append("ParameterType: " + parameterType);
220:
221:                if (webParamAnnot != null) {
222:                    sb.append(newLine);
223:                    sb.append("WebParam: ");
224:                    sb.append(webParamAnnot.toString());
225:                }
226:
227:                if (webServiceRefAnnot != null) {
228:                    sb.append(newLine);
229:                    sb.append("WebServiceRef: ");
230:                    sb.append(webServiceRefAnnot.toString());
231:                }
232:                return sb.toString();
233:            }
234:
235:            public String getRawType() {
236:                return DescriptionBuilderUtils.getRawType(parameterType);
237:            }
238:
239:            public String getHolderActualType() {
240:                return DescriptionBuilderUtils
241:                        .getHolderActualType(parameterType);
242:            }
243:
244:            public boolean isHolderType() {
245:                return DescriptionBuilderUtils.isHolderType(parameterType);
246:            }
247:
248:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.