KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > wsdl > model > extensions > soap > impl > SOAPElementFactoryProvider


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.xml.wsdl.model.extensions.soap.impl;
21
22 import java.util.Collections JavaDoc;
23 import java.util.Set JavaDoc;
24 import javax.xml.namespace.QName JavaDoc;
25 import org.netbeans.modules.xml.wsdl.model.WSDLComponent;
26 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPQName;
27 import org.netbeans.modules.xml.wsdl.model.spi.ElementFactory;
28 import org.w3c.dom.Element JavaDoc;
29
30 /**
31  * @authro Nam Nguyen
32  * @author rico
33  */

34 public class SOAPElementFactoryProvider {
35     
36     public static class BindingFactory extends ElementFactory {
37         public Set JavaDoc<QName JavaDoc> getElementQNames() {
38             return Collections.singleton(SOAPQName.BINDING.getQName());
39         }
40         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
41             return new SOAPBindingImpl(context.getModel(), element);
42         }
43     }
44
45     public static class AddressFactory extends ElementFactory {
46         public Set JavaDoc<QName JavaDoc> getElementQNames() {
47             return Collections.singleton(SOAPQName.ADDRESS.getQName());
48         }
49         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
50             return new SOAPAddressImpl(context.getModel(), element);
51         }
52     }
53
54     public static class BodyFactory extends ElementFactory{
55         public Set JavaDoc<QName JavaDoc> getElementQNames() {
56             return Collections.singleton(SOAPQName.BODY.getQName());
57         }
58         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
59             return new SOAPBodyImpl(context.getModel(), element);
60         }
61     }
62
63     public static class HeaderFactory extends ElementFactory {
64         public Set JavaDoc<QName JavaDoc> getElementQNames() {
65             return Collections.singleton(SOAPQName.HEADER.getQName());
66         }
67         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
68             return new SOAPHeaderImpl(context.getModel(), element);
69         }
70     }
71
72     public static class HeaderFaultFactory extends ElementFactory{
73         public Set JavaDoc<QName JavaDoc> getElementQNames() {
74             return Collections.singleton(SOAPQName.HEADER_FAULT.getQName());
75         }
76         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
77             return new SOAPHeaderFaultImpl(context.getModel(), element);
78         }
79     }
80
81     public static class OperationFactory extends ElementFactory{
82         public Set JavaDoc<QName JavaDoc> getElementQNames() {
83             return Collections.singleton(SOAPQName.OPERATION.getQName());
84         }
85         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
86             return new SOAPOperationImpl(context.getModel(), element);
87         }
88     }
89
90     public static class FaultFactory extends ElementFactory{
91         public Set JavaDoc<QName JavaDoc> getElementQNames() {
92             return Collections.singleton(SOAPQName.FAULT.getQName());
93         }
94         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
95             return new SOAPFaultImpl(context.getModel(), element);
96         }
97     }
98 }
99
Popular Tags