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.snmp.impl;
21:
22: import java.util.Collections;
23: import java.util.Set;
24: import javax.xml.namespace.QName;
25: import org.netbeans.modules.xml.wsdl.model.WSDLComponent;
26: import org.netbeans.modules.wsdlextensions.snmp.SNMPQName;
27: import org.netbeans.modules.xml.wsdl.model.spi.ElementFactory;
28: import org.w3c.dom.Element;
29:
30: public class SNMPElementFactoryProvider {
31:
32: public static class BindingFactory extends ElementFactory {
33: public Set<QName> getElementQNames() {
34: return Collections.singleton(SNMPQName.BINDING.getQName());
35: }
36:
37: public WSDLComponent create(WSDLComponent context,
38: Element element) {
39: return new SNMPBindingImpl(context.getModel(), element);
40: }
41: }
42:
43: public static class AddressFactory extends ElementFactory {
44: public Set<QName> getElementQNames() {
45: return Collections.singleton(SNMPQName.ADDRESS.getQName());
46: }
47:
48: public WSDLComponent create(WSDLComponent context,
49: Element element) {
50: return new SNMPAddressImpl(context.getModel(), element);
51: }
52: }
53:
54: public static class OperationFactory extends ElementFactory {
55: public Set<QName> getElementQNames() {
56: return Collections
57: .singleton(SNMPQName.OPERATION.getQName());
58: }
59:
60: public WSDLComponent create(WSDLComponent context,
61: Element element) {
62: return new SNMPOperationImpl(context.getModel(), element);
63: }
64: }
65:
66: public static class MessageFactory extends ElementFactory {
67: public Set<QName> getElementQNames() {
68: return Collections.singleton(SNMPQName.MESSAGE.getQName());
69: }
70:
71: public WSDLComponent create(WSDLComponent context,
72: Element element) {
73: return new SNMPMessageImpl(context.getModel(), element);
74: }
75: }
76:
77: }
|