Source Code Cross Referenced for WsdlCustom.java in  » XML » jibx-1.1.5 » org » jibx » ws » wsdl » 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 » XML » jibx 1.1.5 » org.jibx.ws.wsdl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:        Copyright (c) 2007, Dennis M. Sosnoski
003:        All rights reserved.
004:
005:        Redistribution and use in source and binary forms, with or without modification,
006:        are permitted provided that the following conditions are met:
007:
008:         * Redistributions of source code must retain the above copyright notice, this
009:           list of conditions and the following disclaimer.
010:         * Redistributions in binary form must reproduce the above copyright notice,
011:           this list of conditions and the following disclaimer in the documentation
012:           and/or other materials provided with the distribution.
013:         * Neither the name of JiBX nor the names of its contributors may be used
014:           to endorse or promote products derived from this software without specific
015:           prior written permission.
016:
017:        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
018:        ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
019:        WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
020:        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
021:        ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
022:        (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
023:        LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
024:        ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
025:        (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
026:        SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
027:         */
028:
029:        package org.jibx.ws.wsdl;
030:
031:        import java.util.ArrayList;
032:        import java.util.HashMap;
033:        import java.util.List;
034:        import java.util.Map;
035:
036:        import org.jibx.binding.generator.IApply;
037:        import org.jibx.binding.generator.SharedNestingBase;
038:        import org.jibx.binding.model.IClassLocator;
039:        import org.jibx.runtime.IUnmarshallingContext;
040:
041:        /**
042:         * Global customization information for WSDL generation. This extends the
043:         * binding customization model to include the information used for service
044:         * definitions.
045:         */
046:        public class WsdlCustom extends NestingBase implements  IApply {
047:            /** Customization value from unmarshalling. */
048:            private String m_wsdlNamespace;
049:
050:            /** List of Fault definitions. */
051:            private final ArrayList m_faultList;
052:
053:            /** Map from fully-qualified class name to Fault information. */
054:            private final Map m_faultMap;
055:
056:            /** List of services, in order added. */
057:            private final ArrayList m_serviceList;
058:
059:            /** Map from fully-qualified class name to service information. */
060:            private final Map m_serviceMap;
061:
062:            /** Class locator. */
063:            private IClassLocator m_locator;
064:
065:            /**
066:             * Constructor.
067:             * 
068:             * @param parent
069:             */
070:            public WsdlCustom(SharedNestingBase parent) {
071:                super (parent);
072:                m_faultList = new ArrayList();
073:                m_faultMap = new HashMap();
074:                m_serviceList = new ArrayList();
075:                m_serviceMap = new HashMap();
076:            }
077:
078:            /**
079:             * Get the namespace for WSDL definitions of services.
080:             * 
081:             * @return WSDL namespace (<code>null</code> if unspecified)
082:             */
083:            public String getWsdlNamespace() {
084:                return m_wsdlNamespace;
085:            }
086:
087:            /**
088:             * Get list of Faults.
089:             *
090:             * @return fault list
091:             */
092:            public List getFaults() {
093:                return m_faultList;
094:            }
095:
096:            /* (non-Javadoc)
097:             * @see org.jibx.binding.generator.SharedNestingBase#getNameStyle()
098:             */
099:            public int getNameStyle() {
100:                return CAMEL_CASE_NAMES;
101:            }
102:
103:            /**
104:             * Get fault customization information. This method should only be used
105:             * after the {@link #apply(IClassLocator)} method is called.
106:             *
107:             * @param type fully qualified class name
108:             * @return fault customization (<code>null</code> if none)
109:             */
110:            public FaultCustom getFaultCustomization(String type) {
111:                return (FaultCustom) m_faultMap.get(type);
112:            }
113:
114:            /**
115:             * Force fault customization information. This method should only be used
116:             * after the {@link #apply(IClassLocator)} method is called. If the fault
117:             * customization information has not previously been created, it will be
118:             * created by this call.
119:             *
120:             * @param type fully qualified exception class name
121:             * @return fault customization (<code>null</code> if none)
122:             */
123:            public FaultCustom forceFaultCustomization(String type) {
124:                FaultCustom fault = (FaultCustom) m_faultMap.get(type);
125:                if (fault == null) {
126:                    fault = new FaultCustom(this , type);
127:                    fault.apply(m_locator);
128:                    m_faultMap.put(type, fault);
129:                }
130:                return fault;
131:            }
132:
133:            /**
134:             * Get list of services.
135:             *
136:             * @return service list
137:             */
138:            public List getServices() {
139:                return m_serviceList;
140:            }
141:
142:            /**
143:             * Get service customization information. This method should only be used
144:             * after the {@link #apply(IClassLocator)} method is called.
145:             *
146:             * @param type fully qualified class name
147:             * @return service customization (<code>null</code> if none)
148:             */
149:            public ServiceCustom getServiceCustomization(String type) {
150:                return (ServiceCustom) m_serviceMap.get(type);
151:            }
152:
153:            /**
154:             * Add new service customization. This creates the service customization,
155:             * using defaults, and adds it to the internal structures. This method
156:             * should only be used after first calling {@link
157:             * #getServiceCustomization(String)} and obtaining a <code>null</code>
158:             * result.
159:             *
160:             * @param type fully qualified class name
161:             * @return service customization
162:             */
163:            public ServiceCustom addServiceCustomization(String type) {
164:                ServiceCustom service = new ServiceCustom(this , type);
165:                service.apply(m_locator);
166:                m_serviceList.add(service);
167:                m_serviceMap.put(type, service);
168:                return service;
169:            }
170:
171:            /**
172:             * Unmarshalling factory. This gets the containing element and the name so
173:             * that the standard constructor can be used.
174:             *
175:             * @param ictx
176:             * @return created instance
177:             */
178:            private static WsdlCustom factory(IUnmarshallingContext ictx) {
179:                return new WsdlCustom(getContainingClass(ictx));
180:            }
181:
182:            /**
183:             * Apply customizations to services to fill out members.
184:             *
185:             * @param icl class locator
186:             */
187:            public void apply(IClassLocator icl) {
188:
189:                // save locator for later use (when services are added)
190:                m_locator = icl;
191:
192:                // fix Faults and create map
193:                for (int i = 0; i < m_faultList.size(); i++) {
194:                    FaultCustom fault = (FaultCustom) m_faultList.get(i);
195:                    fault.apply(icl);
196:                    m_faultMap.put(fault.getExceptionType(), fault);
197:                }
198:
199:                // register services with names supplied (priority over generated names)
200:                for (int i = 0; i < m_serviceList.size(); i++) {
201:                    ServiceCustom service = (ServiceCustom) m_serviceList
202:                            .get(i);
203:                    String name = service.getServiceName();
204:                    if (name != null) {
205:                        if (registerName(name, service) != name) {
206:                            throw new IllegalStateException(
207:                                    "Duplicate service name " + name);
208:                        }
209:                    }
210:                }
211:
212:                // fix services and create map
213:                for (int i = 0; i < m_serviceList.size(); i++) {
214:                    ServiceCustom service = (ServiceCustom) m_serviceList
215:                            .get(i);
216:                    service.apply(icl);
217:                    m_serviceMap.put(service.getClassName(), service);
218:                }
219:            }
220:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.