KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > wsitmodelext > addressing > Addressing10Factories


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 2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.websvc.wsitmodelext.addressing;
21
22 import org.netbeans.modules.websvc.wsitmodelext.addressing.impl.Address10Impl;
23 import org.netbeans.modules.websvc.wsitmodelext.addressing.impl.Addressing10EndpointReferenceImpl;
24 import org.netbeans.modules.websvc.wsitmodelext.addressing.impl.Addressing10MetadataImpl;
25 import org.netbeans.modules.websvc.wsitmodelext.addressing.impl.Addressing10ReferencePropertiesImpl;
26 import org.netbeans.modules.xml.wsdl.model.WSDLComponent;
27 import org.netbeans.modules.xml.wsdl.model.spi.ElementFactory;
28 import org.w3c.dom.Element JavaDoc;
29
30 import javax.xml.namespace.QName JavaDoc;
31 import java.util.Collections JavaDoc;
32 import java.util.Set JavaDoc;
33 import org.netbeans.modules.websvc.wsitmodelext.addressing.impl.Addressing10AnonymousImpl;
34 import org.netbeans.modules.websvc.wsitmodelext.addressing.impl.Addressing10WsdlUsingAddressingImpl;
35
36
37 public class Addressing10Factories {
38
39     public static class EndpointReferenceFactory extends ElementFactory {
40         @Override JavaDoc
41         public Set JavaDoc<QName JavaDoc> getElementQNames() {
42             return Collections.singleton(Addressing10QName.ENDPOINTREFERENCE.getQName());
43         }
44         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
45             return type.cast(new Addressing10EndpointReferenceImpl(context.getModel()));
46         }
47
48         @Override JavaDoc
49         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
50             return new Addressing10EndpointReferenceImpl(context.getModel(), element);
51         }
52     }
53
54     public static class AnonymousFactory extends ElementFactory {
55         @Override JavaDoc
56         public Set JavaDoc<QName JavaDoc> getElementQNames() {
57             return Collections.singleton(Addressing10QName.ANONYMOUS.getQName());
58         }
59         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
60             return type.cast(new Addressing10AnonymousImpl(context.getModel()));
61         }
62
63         @Override JavaDoc
64         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
65             return new Addressing10AnonymousImpl(context.getModel(), element);
66         }
67     }
68     
69     public static class Address10Factory extends ElementFactory {
70         @Override JavaDoc
71         public Set JavaDoc<QName JavaDoc> getElementQNames() {
72             return Collections.singleton(Addressing10QName.ADDRESS.getQName());
73         }
74         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
75             return type.cast(new Address10Impl(context.getModel()));
76         }
77
78         @Override JavaDoc
79         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
80             return new Address10Impl(context.getModel(), element);
81         }
82     }
83     
84     public static class Addressing10MetadataFactory extends ElementFactory {
85         @Override JavaDoc
86         public Set JavaDoc<QName JavaDoc> getElementQNames() {
87             return Collections.singleton(Addressing10QName.ADDRESS.getQName());
88         }
89         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
90             return type.cast(new Addressing10MetadataImpl(context.getModel()));
91         }
92
93         @Override JavaDoc
94         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
95             return new Addressing10MetadataImpl(context.getModel(), element);
96         }
97     }
98     
99     public static class Addressing10ReferencePropertiesFactory extends ElementFactory {
100         @Override JavaDoc
101         public Set JavaDoc<QName JavaDoc> getElementQNames() {
102             return Collections.singleton(Addressing10QName.REFERENCEPROPERTIES.getQName());
103         }
104         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
105             return type.cast(new Addressing10ReferencePropertiesImpl(context.getModel()));
106         }
107
108         @Override JavaDoc
109         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
110             return new Addressing10ReferencePropertiesImpl(context.getModel(), element);
111         }
112     }
113 }
114
Popular Tags