Source Code Cross Referenced for DefinitionDescriptorImpl.java in  » Portal » Open-Portal » com » sun » portal » providers » simplewebservice » wsdl » impl » 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 » Portal » Open Portal » com.sun.portal.providers.simplewebservice.wsdl.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * $Id: DefinitionDescriptorImpl.java,v 1.5 2003/06/03 10:49:23 sy131129 Exp $
003:         * Copyright 2002-2003 Sun Microsystems, Inc. All
004:         * rights reserved. Use of this product is subject
005:         * to license terms. Federal Acquisitions:
006:         * Commercial Software -- Government Users
007:         * Subject to Standard License Terms and
008:         * Conditions.
009:         *
010:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011:         * are trademarks or registered trademarks of Sun Microsystems,
012:         * Inc. in the United States and other countries.
013:         */package com.sun.portal.providers.simplewebservice.wsdl.impl;
014:
015:        import java.util.Map;
016:        import java.util.Set;
017:        import java.util.HashMap;
018:        import java.util.Iterator;
019:
020:        import com.sun.portal.providers.simplewebservice.wsdl.TypeDescriptor;
021:        import com.sun.portal.providers.simplewebservice.wsdl.MessageDescriptor;
022:        import com.sun.portal.providers.simplewebservice.wsdl.PortTypeDescriptor;
023:        import com.sun.portal.providers.simplewebservice.wsdl.BindingDescriptor;
024:        import com.sun.portal.providers.simplewebservice.wsdl.ServiceDescriptor;
025:        import com.sun.portal.providers.simplewebservice.wsdl.DefinitionDescriptor;
026:
027:        /**
028:         * This class represents a WSDL definition.
029:         *
030:         */
031:        public class DefinitionDescriptorImpl implements  DefinitionDescriptor {
032:
033:            private String name = null;
034:            private String targetNamespace = null;
035:            private Map namespaces = new HashMap();
036:            private Map typeDescriptors = new HashMap();
037:            private Map messageDescriptors = new HashMap();
038:            private Map bindingDescriptors = new HashMap();
039:            private Map portTypeDescriptors = new HashMap();
040:            private Map serviceDescriptors = new HashMap();
041:
042:            /**
043:             * Default Constructor.
044:             *
045:             * @param name the name of the DefinitionDescriptor.
046:             * @param targetNamespace the targetNamespace of the DefinitionDescriptor.
047:             * @param namespaces the namespaces that are part of the DefinitionDescriptor.
048:             * @param typeDescriptors the TypeDescriptors that are part of the DefinitionDescriptor.   
049:             * @param messageDescriptors the MessageDescriptors that are part of the DefinitionDescriptor.
050:             * @param bindingDescriptors the BindingDescriptors that are part of the DefinitionDescriptor.
051:             * @param portTypeDescriptors the PortTypeDescriptors that are part of the DefinitionDescriptor.
052:             * @param serviceDescriptors the ServiceDescriptors that are part of the DefinitionDescriptor.   
053:             */
054:            public DefinitionDescriptorImpl(String name,
055:                    String targetNamespace, Map namespaces,
056:                    Map typeDescriptors, Map messageDescriptors,
057:                    Map bindingDescriptors, Map portTypeDescriptors,
058:                    Map serviceDescriptors) {
059:                this .name = name;
060:                this .targetNamespace = targetNamespace;
061:                this .namespaces = namespaces;
062:                this .typeDescriptors = typeDescriptors;
063:                this .messageDescriptors = messageDescriptors;
064:                this .bindingDescriptors = bindingDescriptors;
065:                this .portTypeDescriptors = portTypeDescriptors;
066:                this .serviceDescriptors = serviceDescriptors;
067:            }
068:
069:            /**
070:             * Get the name of this definition.
071:             *
072:             * @return the definition name
073:             */
074:            public String getName() {
075:                return name;
076:            }
077:
078:            /**
079:             * Get the target namespace in which the WSDL elements
080:             * are defined.
081:             *
082:             * @return the target namespace
083:             */
084:            public String getTargetNamespace() {
085:                return targetNamespace;
086:            }
087:
088:            /**
089:             * Get the namespace URI associated with this prefix. Or null if
090:             * there is no namespace URI associated with this prefix. 
091:             *
092:             * @param prefix the prefix for which to fetch the namespace URI for.
093:             *
094:             * @return the target namespace.
095:             */
096:            public String getNamespace(String prefix) {
097:                return (String) namespaces.get(prefix);
098:            }
099:
100:            /**
101:             * Get a prefix associated with this namespace URI. Or null if
102:             * there are no prefixes associated with this namespace URI. 
103:             *
104:             * @param namespaceURI the namespace URI for which to fetch the prefix for.
105:             *
106:             * @return the target prefix.
107:             */
108:            public String getPrefix(String namespaceURI) {
109:                String value = null;
110:
111:                if (namespaceURI != null) {
112:                    Iterator entryIterator = namespaces.entrySet().iterator();
113:
114:                    while (entryIterator.hasNext()) {
115:                        Map.Entry entry = (Map.Entry) entryIterator.next();
116:                        String prefix = (String) entry.getKey();
117:                        String assocNamespaceURI = (String) entry.getValue();
118:
119:                        if (namespaceURI.equals(assocNamespaceURI)) {
120:                            value = prefix;
121:                            break;
122:                        }
123:                    }
124:                }
125:
126:                return value;
127:            }
128:
129:            /**
130:             * Get all namespace associations in this definition. The keys are
131:             * the prefixes, and the namespace URIs are the values. 
132:             *
133:             * @return all the Namespaces
134:             */
135:            public Map getNamespaces() {
136:                return namespaces;
137:            }
138:
139:            /**
140:             * Get the specified TypeDescriptor. 
141:             *
142:             * @param name the name of the desired TypeDescriptor.
143:             *
144:             * @return the corresponding TypeDescriptor, or null if there wasn't
145:             *         any matching TypeDescriptor.
146:             */
147:            public TypeDescriptor getTypeDescriptor(String name) {
148:                TypeDescriptor typeDescriptor = (TypeDescriptor) typeDescriptors
149:                        .get(name);
150:
151:                return typeDescriptor;
152:            }
153:
154:            /**
155:             * Get all the TypeDescriptors defined here.
156:             *
157:             * @return all the TypeDescriptors.
158:             */
159:            public Map getTypeDescriptors() {
160:                return typeDescriptors;
161:            }
162:
163:            /**
164:             * Get the specified MessageDescriptor. 
165:             *
166:             * @param name the name of the desired MessageDescriptor.
167:             *
168:             * @return the corresponding MessageDescriptor, or null if there wasn't
169:             *         any matching MessageDescriptor.
170:             */
171:            public MessageDescriptor getMessageDescriptor(String name) {
172:                MessageDescriptor messageDescriptor = (MessageDescriptor) messageDescriptors
173:                        .get(name);
174:
175:                return messageDescriptor;
176:            }
177:
178:            /**
179:             * Get all the MessageDescriptors defined here.
180:             *
181:             * @return all the MessageDescriptors.
182:             */
183:            public Map getMessageDescriptors() {
184:                return messageDescriptors;
185:            }
186:
187:            /**
188:             * Get the specified PortTypeDescriptor.
189:             *
190:             * @param name the name of the desired PortTypeDescriptor.
191:             * 
192:             * @return the corresponding PortTypeDescriptor, or null if there wasn't
193:             *          any matching PortTypeDescriptor
194:             */
195:            public PortTypeDescriptor getPortTypeDescriptor(String name) {
196:                PortTypeDescriptor portTypeDescriptor = (PortTypeDescriptor) portTypeDescriptors
197:                        .get(name);
198:
199:                return portTypeDescriptor;
200:            }
201:
202:            /**
203:             * Get all the PortTypeDescriptors defined here.
204:             *
205:             * @return all the PortTypeDescriptors.   
206:             */
207:            public Map getPortTypeDescriptors() {
208:                return portTypeDescriptors;
209:            }
210:
211:            /**
212:             * Get the specified BindingDescriptor.
213:             *
214:             * @param name the name of the desired BindingDescriptor.
215:             * 
216:             * @return the corresponding BindingDescriptor, or null if there wasn't
217:             *         any matching BindingDescriptor.
218:             */
219:            public BindingDescriptor getBindingDescriptor(String name) {
220:                BindingDescriptor bindingDescriptor = (BindingDescriptor) bindingDescriptors
221:                        .get(name);
222:
223:                return bindingDescriptor;
224:            }
225:
226:            /**
227:             * Get all the BindingDescriptor defined here.
228:             *
229:             * @return all the BindingDesciptors.
230:             */
231:            public Map getBindingDescriptors() {
232:                return bindingDescriptors;
233:            }
234:
235:            /**
236:             * Get the specified ServiceDescriptor. 
237:             *
238:             * @param name the name of the desired ServiceDescriptor.
239:             *
240:             * @return the corresponding ServiceDescriptor, or null if there wasn't
241:             *         any matching ServiceDescriptor.
242:             */
243:            public ServiceDescriptor getServiceDescriptor(String name) {
244:                ServiceDescriptor serviceDescriptor = (ServiceDescriptor) serviceDescriptors
245:                        .get(name);
246:
247:                return serviceDescriptor;
248:            }
249:
250:            /**
251:             * Get all the ServiceDescriptor defined here.
252:             *
253:             * @return all the ServiceDescriptors.   
254:             */
255:            public Map getServiceDescriptors() {
256:                return serviceDescriptors;
257:            }
258:
259:            /**
260:             * Get the String representation of this DefinitionDescriptor.
261:             *
262:             * @return the String representation of this DefinitionDescriptor.
263:             */
264:            public String toString() {
265:                StringBuffer strBuf = new StringBuffer();
266:
267:                strBuf.append("\nDefinitionDescriptor: name=" + name
268:                        + " targetNamespace=" + targetNamespace);
269:
270:                if (namespaces != null) {
271:                    Set keySet = namespaces.keySet();
272:                    Iterator keyIterator = keySet.iterator();
273:
274:                    strBuf.append("\nNamespaces: ");
275:                    while (keyIterator.hasNext()) {
276:                        String key = (String) keyIterator.next();
277:                        strBuf.append("\n" + key + "=" + namespaces.get(key));
278:                    }
279:                }
280:
281:                if (typeDescriptors != null) {
282:                    Iterator typeDescriptorIterator = typeDescriptors.values()
283:                            .iterator();
284:
285:                    while (typeDescriptorIterator.hasNext()) {
286:                        strBuf.append("\n" + typeDescriptorIterator.next());
287:                    }
288:                }
289:
290:                if (messageDescriptors != null) {
291:                    Iterator messageDescriptorIterator = messageDescriptors
292:                            .values().iterator();
293:
294:                    while (messageDescriptorIterator.hasNext()) {
295:                        strBuf.append("\n" + messageDescriptorIterator.next());
296:                    }
297:                }
298:
299:                if (portTypeDescriptors != null) {
300:                    Iterator portTypeDescriptorIterator = portTypeDescriptors
301:                            .values().iterator();
302:
303:                    while (portTypeDescriptorIterator.hasNext()) {
304:                        strBuf.append("\n" + portTypeDescriptorIterator.next());
305:                    }
306:                }
307:
308:                if (bindingDescriptors != null) {
309:                    Iterator bindingDescriptorIterator = bindingDescriptors
310:                            .values().iterator();
311:
312:                    while (bindingDescriptorIterator.hasNext()) {
313:                        strBuf.append("\n" + bindingDescriptorIterator.next());
314:                    }
315:                }
316:
317:                if (serviceDescriptors != null) {
318:                    Iterator serviceDescriptorIterator = serviceDescriptors
319:                            .values().iterator();
320:
321:                    while (serviceDescriptorIterator.hasNext()) {
322:                        strBuf.append("\n" + serviceDescriptorIterator.next());
323:                    }
324:                }
325:
326:                return strBuf.toString();
327:            }
328:        }
w__w___w___.ja__v_a2___s__.com__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.