001: /*
002: * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025: package com.sun.tools.internal.ws.wsdl.document.jaxws;
026:
027: import java.util.ArrayList;
028: import java.util.HashSet;
029: import java.util.Iterator;
030: import java.util.List;
031: import java.util.Set;
032:
033: import javax.xml.namespace.QName;
034:
035: import org.w3c.dom.Element;
036:
037: import com.sun.tools.internal.ws.wsdl.framework.Extensible;
038: import com.sun.tools.internal.ws.wsdl.framework.Extension;
039:
040: /**
041: * @author Vivek Pandey
042: *
043: * To change the template for this generated type comment go to
044: * Window>Preferences>Java>Code Generation>Code and Comments
045: */
046: public class JAXWSBinding extends Extension implements Extensible {
047:
048: /**
049: *
050: */
051: public JAXWSBinding() {
052: super ();
053: jaxbBindings = new HashSet<Element>();
054: // TODO Auto-generated constructor stub
055: }
056:
057: /* (non-Javadoc)
058: * @see Entity#validateThis()
059: */
060: public void validateThis() {
061: // TODO Auto-generated method stub
062:
063: }
064:
065: /* (non-Javadoc)
066: * @see Elemental#getElementName()
067: */
068: public QName getElementName() {
069: // TODO Auto-generated method stub
070: return JAXWSBindingsConstants.JAXWS_BINDINGS;
071: }
072:
073: /* (non-Javadoc)
074: * @see Extensible#addExtension(Extension)
075: */
076: public void addExtension(Extension e) {
077: // TODO Auto-generated method stub
078:
079: }
080:
081: /* (non-Javadoc)
082: * @see Extensible#extensions()
083: */
084: public Iterator extensions() {
085: // TODO Auto-generated method stub
086: return null;
087: }
088:
089: // /**
090: // * @return Returns the enableAdditionalHeaderMapping.
091: // */
092: // public Boolean isEnableAdditionalHeaderMapping() {
093: // return enableAdditionalHeaderMapping;
094: // }
095: // /**
096: // * @param enableAdditionalHeaderMapping The enableAdditionalHeaderMapping to set.
097: // */
098: // public void setEnableAdditionalHeaderMapping(
099: // Boolean enableAdditionalHeaderMapping) {
100: // this.enableAdditionalHeaderMapping = enableAdditionalHeaderMapping;
101: // }
102: /**
103: * @return Returns the enableAsyncMapping.
104: */
105: public Boolean isEnableAsyncMapping() {
106: return enableAsyncMapping;
107: }
108:
109: /**
110: * @param enableAsyncMapping The enableAsyncMapping to set.
111: */
112: public void setEnableAsyncMapping(Boolean enableAsyncMapping) {
113: this .enableAsyncMapping = enableAsyncMapping;
114: }
115:
116: /**
117: * @return Returns the enableMimeContentMapping.
118: */
119: public Boolean isEnableMimeContentMapping() {
120: return enableMimeContentMapping;
121: }
122:
123: /**
124: * @param enableMimeContentMapping The enableMimeContentMapping to set.
125: */
126: public void setEnableMimeContentMapping(
127: Boolean enableMimeContentMapping) {
128: this .enableMimeContentMapping = enableMimeContentMapping;
129: }
130:
131: /**
132: * @return Returns the enableWrapperStyle.
133: */
134: public Boolean isEnableWrapperStyle() {
135: return enableWrapperStyle;
136: }
137:
138: /**
139: * @param enableWrapperStyle The enableWrapperStyle to set.
140: */
141: public void setEnableWrapperStyle(Boolean enableWrapperStyle) {
142: this .enableWrapperStyle = enableWrapperStyle;
143: }
144:
145: /**
146: * @return Returns the jaxwsPackage.
147: */
148: public CustomName getJaxwsPackage() {
149: return jaxwsPackage;
150: }
151:
152: /**
153: * @param jaxwsPackage The jaxwsPackage to set.
154: */
155: public void setJaxwsPackage(CustomName jaxwsPackage) {
156: this .jaxwsPackage = jaxwsPackage;
157: }
158:
159: /**
160: * @return Returns the node.
161: */
162: public String getNode() {
163: return node;
164: }
165:
166: /**
167: * @param node The node to set.
168: */
169: public void setNode(String node) {
170: this .node = node;
171: }
172:
173: /**
174: * @return Returns the version.
175: */
176: public String getVersion() {
177: return version;
178: }
179:
180: /**
181: * @param version The version to set.
182: */
183: public void setVersion(String version) {
184: this .version = version;
185: }
186:
187: /**
188: * @return Returns the wsdlLocation.
189: */
190: public String getWsdlLocation() {
191: return wsdlLocation;
192: }
193:
194: /**
195: * @param wsdlLocation The wsdlLocation to set.
196: */
197: public void setWsdlLocation(String wsdlLocation) {
198: this .wsdlLocation = wsdlLocation;
199: }
200:
201: /**
202: * @return Returns the wsdlNamespace.
203: */
204: public String getWsdlNamespace() {
205: return wsdlNamespace;
206: }
207:
208: /**
209: * @param wsdlNamespace The wsdlNamespace to set.
210: */
211: public void setWsdlNamespace(String wsdlNamespace) {
212: this .wsdlNamespace = wsdlNamespace;
213: }
214:
215: /**
216: * @return Returns the jaxbBindings.
217: */
218: public Set<Element> getJaxbBindings() {
219: return jaxbBindings;
220: }
221:
222: /**
223: * @param jaxbBinding The jaxbBindings to set.
224: */
225: public void addJaxbBindings(Element jaxbBinding) {
226: if (jaxbBindings == null)
227: return;
228: this .jaxbBindings.add(jaxbBinding);
229: }
230:
231: /**
232: * @return the isProvider.
233: */
234: public Boolean isProvider() {
235: return isProvider;
236: }
237:
238: /**
239: * @param isProvider The isProvider to set.
240: */
241: public void setProvider(Boolean isProvider) {
242: this .isProvider = isProvider;
243: }
244:
245: /* (non-Javadoc)
246: * @see Entity#getProperty(java.lang.String)
247: */
248: public Object getProperty(String key) {
249: if (key.equals(JAXWSBindingsConstants.JAXB_BINDINGS))
250: return jaxbBindings;
251: return null;
252: }
253:
254: /**
255: * @return Returns the methodName.
256: */
257: public CustomName getMethodName() {
258: return methodName;
259: }
260:
261: /**
262: * @param methodName The methodName to set.
263: */
264: public void setMethodName(CustomName methodName) {
265: this .methodName = methodName;
266: }
267:
268: /**
269: * @return Returns the parameter.
270: */
271: public Iterator<Parameter> parameters() {
272: return parameters.iterator();
273: }
274:
275: /**
276: * @param parameter The parameter to set.
277: */
278: public void addParameter(Parameter parameter) {
279: if (parameters == null)
280: parameters = new ArrayList<Parameter>();
281: parameters.add(parameter);
282: }
283:
284: public String getParameterName(String msgName, String wsdlPartName,
285: QName element, boolean wrapperStyle) {
286: if (msgName == null || wsdlPartName == null || element == null
287: || parameters == null)
288: return null;
289: for (Parameter param : parameters) {
290: if (param.getMessageName().equals(msgName)
291: && param.getPart().equals(wsdlPartName)) {
292: if (wrapperStyle && (param.getElement() != null)) {
293: if (param.getElement().equals(element))
294: return param.getName();
295: } else if (!wrapperStyle) {
296: return param.getName();
297: }
298: }
299: }
300: return null;
301: }
302:
303: /**
304: * @return Returns the className.
305: */
306: public CustomName getClassName() {
307: return className;
308: }
309:
310: /**
311: * @param className The className to set.
312: */
313: public void setClassName(CustomName className) {
314: this .className = className;
315: }
316:
317: /**
318: * @return Returns the exception.
319: */
320: public Exception getException() {
321: return exception;
322: }
323:
324: /**
325: * @param exception The exception to set.
326: */
327: public void setException(Exception exception) {
328: this .exception = exception;
329: }
330:
331: private String wsdlNamespace;
332: private String wsdlLocation;
333: private String node;
334: private String version;
335:
336: private CustomName jaxwsPackage;
337: private List<Parameter> parameters;
338: private Boolean enableWrapperStyle;
339: private Boolean enableAsyncMapping;
340: // private Boolean enableAdditionalHeaderMapping;
341: private Boolean enableMimeContentMapping;
342: private Boolean isProvider;
343: private Exception exception;
344:
345: private Set<Element> jaxbBindings;
346:
347: // portType className
348: private CustomName className;
349:
350: //portType Operation
351: private CustomName methodName;
352: }
|