001: /*
002: * The contents of this file are subject to the terms of the Common Development
003: * and Distribution License (the License). You may not use this file except in
004: * compliance with the License.
005: *
006: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007: * or http://www.netbeans.org/cddl.txt.
008: *
009: * When distributing Covered Code, include this CDDL Header Notice in each file
010: * and include the License file at http://www.netbeans.org/cddl.txt.
011: * If applicable, add the following below the CDDL Header, with the fields
012: * enclosed by brackets [] replaced by your own identifying information:
013: * "Portions Copyrighted [year] [name of copyright owner]"
014: *
015: * The Original Software is NetBeans. The Initial Developer of the Original
016: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017: * Microsystems, Inc. All Rights Reserved.
018: */
019:
020: package org.netbeans.modules.wsdlextensions.jms.impl;
021:
022: import java.util.ArrayList;
023: import java.util.Collection;
024: import java.util.Collections;
025: import java.util.Set;
026: import javax.xml.namespace.QName;
027: import org.netbeans.modules.xml.wsdl.model.WSDLComponent;
028: import org.netbeans.modules.wsdlextensions.jms.JMSQName;
029: import org.netbeans.modules.xml.wsdl.model.spi.ElementFactory;
030: import org.w3c.dom.Element;
031:
032: /**
033: * JMSElementFactoryProvider
034: */
035: public class JMSElementFactoryProvider {
036:
037: public static class BindingFactory extends ElementFactory {
038: public Set<QName> getElementQNames() {
039: return Collections.singleton(JMSQName.BINDING.getQName());
040: }
041:
042: public WSDLComponent create(WSDLComponent context,
043: Element element) {
044: return new JMSBindingImpl(context.getModel(), element);
045: }
046: }
047:
048: public static class AddressFactory extends ElementFactory {
049: public Set<QName> getElementQNames() {
050: return Collections.singleton(JMSQName.ADDRESS.getQName());
051: }
052:
053: public WSDLComponent create(WSDLComponent context,
054: Element element) {
055: return new JMSAddressImpl(context.getModel(), element);
056: }
057: }
058:
059: public static class OperationFactory extends ElementFactory {
060: public Set<QName> getElementQNames() {
061: return Collections.singleton(JMSQName.OPERATION.getQName());
062: }
063:
064: public WSDLComponent create(WSDLComponent context,
065: Element element) {
066: return new JMSOperationImpl(context.getModel(), element);
067: }
068: }
069:
070: public static class MessageFactory extends ElementFactory {
071: public Set<QName> getElementQNames() {
072: return Collections.singleton(JMSQName.MESSAGE.getQName());
073: }
074:
075: public WSDLComponent create(WSDLComponent context,
076: Element element) {
077: return new JMSMessageImpl(context.getModel(), element);
078: }
079: }
080:
081: public static class OptionsFactory extends ElementFactory {
082: public Set<QName> getElementQNames() {
083: return Collections.singleton(JMSQName.OPTIONS.getQName());
084: }
085:
086: public WSDLComponent create(WSDLComponent context,
087: Element element) {
088: return new JMSOptionsImpl(context.getModel(), element);
089: }
090: }
091:
092: public static class OptionFactory extends ElementFactory {
093: public Set<QName> getElementQNames() {
094: return Collections.singleton(JMSQName.OPTION.getQName());
095: }
096:
097: public WSDLComponent create(WSDLComponent context,
098: Element element) {
099: return new JMSOptionImpl(context.getModel(), element);
100: }
101: }
102:
103: public static class JNDIEnvFactory extends ElementFactory {
104: public Set<QName> getElementQNames() {
105: return Collections.singleton(JMSQName.JNDIENV.getQName());
106: }
107:
108: public WSDLComponent create(WSDLComponent context,
109: Element element) {
110: return new JMSJNDIEnvImpl(context.getModel(), element);
111: }
112: }
113:
114: public static class JNDIEnvEntryFactory extends ElementFactory {
115: public Set<QName> getElementQNames() {
116: return Collections.singleton(JMSQName.JNDIENVENTRY
117: .getQName());
118: }
119:
120: public WSDLComponent create(WSDLComponent context,
121: Element element) {
122: return new JMSJNDIEnvEntryImpl(context.getModel(), element);
123: }
124: }
125:
126: public static class MapMessageFactory extends ElementFactory {
127: public Set<QName> getElementQNames() {
128: return Collections
129: .singleton(JMSQName.MAPMESSAGE.getQName());
130: }
131:
132: public WSDLComponent create(WSDLComponent context,
133: Element element) {
134: return new JMSMapMessageImpl(context.getModel(), element);
135: }
136: }
137:
138: public static class MapMessagePartFactory extends ElementFactory {
139: public Set<QName> getElementQNames() {
140: return Collections.singleton(JMSQName.MAPPART.getQName());
141: }
142:
143: public WSDLComponent create(WSDLComponent context,
144: Element element) {
145: return new JMSMapMessagePartImpl(context.getModel(),
146: element);
147: }
148: }
149:
150: public static class PropertiesFactory extends ElementFactory {
151: public Set<QName> getElementQNames() {
152: return Collections
153: .singleton(JMSQName.PROPERTIES.getQName());
154: }
155:
156: public WSDLComponent create(WSDLComponent context,
157: Element element) {
158: return new JMSPropertiesImpl(context.getModel(), element);
159: }
160: }
161:
162: public static class PropertyFactory extends ElementFactory {
163: public Set<QName> getElementQNames() {
164: return Collections.singleton(JMSQName.PROPERTY.getQName());
165: }
166:
167: public WSDLComponent create(WSDLComponent context,
168: Element element) {
169: return new JMSPropertyImpl(context.getModel(), element);
170: }
171: }
172:
173: }
|