01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * 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-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19:
20: package org.netbeans.modules.wsdlextensions.file.model.impl;
21:
22: import java.util.Collections;
23: import java.util.Set;
24: import javax.xml.namespace.QName;
25:
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;
29:
30: import org.netbeans.modules.wsdlextensions.file.model.FileQName;
31:
32: /**
33: ** @author sweng
34: */
35: public class FileElementFactoryProvider {
36:
37: public static class BindingFactory extends ElementFactory {
38: public Set<QName> getElementQNames() {
39: return Collections.singleton(FileQName.BINDING.getQName());
40: }
41:
42: public WSDLComponent create(WSDLComponent context,
43: Element element) {
44: return new FileBindingImpl(context.getModel(), element);
45: }
46: }
47:
48: public static class AddressFactory extends ElementFactory {
49: public Set<QName> getElementQNames() {
50: return Collections.singleton(FileQName.ADDRESS.getQName());
51: }
52:
53: public WSDLComponent create(WSDLComponent context,
54: Element element) {
55: return new FileAddressImpl(context.getModel(), element);
56: }
57: }
58:
59: public static class OperationFactory extends ElementFactory {
60: public Set<QName> getElementQNames() {
61: return Collections
62: .singleton(FileQName.OPERATION.getQName());
63: }
64:
65: public WSDLComponent create(WSDLComponent context,
66: Element element) {
67: return new FileOperationImpl(context.getModel(), element);
68: }
69: }
70:
71: public static class MessageFactory extends ElementFactory {
72: public Set<QName> getElementQNames() {
73: return Collections.singleton(FileQName.MESSAGE.getQName());
74: }
75:
76: public WSDLComponent create(WSDLComponent context,
77: Element element) {
78: return new FileMessageImpl(context.getModel(), element);
79: }
80: }
81: }
|