001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common Development
008: * and Distribution License("CDDL") (collectively, the "License"). You
009: * may not use this file except in compliance with the License. You can obtain
010: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
011: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
012: * language governing permissions and limitations under the License.
013: *
014: * When distributing the software, include this License Header Notice in each
015: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
016: * Sun designates this particular file as subject to the "Classpath" exception
017: * as provided by Sun in the GPL Version 2 section of the License file that
018: * accompanied this code. If applicable, add the following below the License
019: * Header, with the fields enclosed by brackets [] replaced by your own
020: * identifying information: "Portions Copyrighted [year]
021: * [name of copyright owner]"
022: *
023: * Contributor(s):
024: *
025: * If you wish your version of this file to be governed by only the CDDL or
026: * only the GPL Version 2, indicate your decision by adding "[Contributor]
027: * elects to include this software in this distribution under the [CDDL or GPL
028: * Version 2] license." If you don't indicate a single choice of license, a
029: * recipient has the option to distribute your version of this file under
030: * either the CDDL, the GPL Version 2 or to extend the choice of license to
031: * its licensees as provided above. However, if you add GPL Version 2 code
032: * and therefore, elected the GPL Version 2 license, then the option applies
033: * only if the new code is made subject to such option by the copyright
034: * holder.
035: */
036: package com.sun.tools.ws.wsdl.document.jaxws;
037:
038: import com.sun.tools.ws.wsdl.framework.ExtensionImpl;
039: import org.w3c.dom.Element;
040: import org.xml.sax.Locator;
041:
042: import javax.xml.namespace.QName;
043: import java.util.*;
044:
045: /**
046: * @author Vivek Pandey
047: *
048: * To change the template for this generated type comment go to
049: * Window>Preferences>Java>Code Generation>Code and Comments
050: */
051: public class JAXWSBinding extends ExtensionImpl {
052:
053: /**
054: *
055: */
056: public JAXWSBinding(Locator locator) {
057: super (locator);
058: jaxbBindings = new HashSet<Element>();
059: // TODO Auto-generated constructor stub
060: }
061:
062: /* (non-Javadoc)
063: * @see Entity#validateThis()
064: */
065: public void validateThis() {
066: // TODO Auto-generated method stub
067:
068: }
069:
070: /* (non-Javadoc)
071: * @see Elemental#getElementName()
072: */
073: public QName getElementName() {
074: // TODO Auto-generated method stub
075: return JAXWSBindingsConstants.JAXWS_BINDINGS;
076: }
077:
078: public QName getWSDLElementName() {
079: return getElementName();
080: }
081:
082: /* (non-Javadoc)
083: * @see TWSDLExtensible#addExtension(ExtensionImpl)
084: */
085: public void addExtension(ExtensionImpl e) {
086: // TODO Auto-generated method stub
087:
088: }
089:
090: /* (non-Javadoc)
091: * @see TWSDLExtensible#extensions()
092: */
093: public Iterable<ExtensionImpl> extensions() {
094: // TODO Auto-generated method stub
095: return null;
096: }
097:
098: // /**
099: // * @return Returns the enableAdditionalHeaderMapping.
100: // */
101: // public Boolean isEnableAdditionalHeaderMapping() {
102: // return enableAdditionalHeaderMapping;
103: // }
104: // /**
105: // * @param enableAdditionalHeaderMapping The enableAdditionalHeaderMapping to set.
106: // */
107: // public void setEnableAdditionalHeaderMapping(
108: // Boolean enableAdditionalHeaderMapping) {
109: // this.enableAdditionalHeaderMapping = enableAdditionalHeaderMapping;
110: // }
111: /**
112: * @return Returns the enableAsyncMapping.
113: */
114: public Boolean isEnableAsyncMapping() {
115: return enableAsyncMapping;
116: }
117:
118: /**
119: * @param enableAsyncMapping The enableAsyncMapping to set.
120: */
121: public void setEnableAsyncMapping(Boolean enableAsyncMapping) {
122: this .enableAsyncMapping = enableAsyncMapping;
123: }
124:
125: /**
126: * @return Returns the enableMimeContentMapping.
127: */
128: public Boolean isEnableMimeContentMapping() {
129: return enableMimeContentMapping;
130: }
131:
132: /**
133: * @param enableMimeContentMapping The enableMimeContentMapping to set.
134: */
135: public void setEnableMimeContentMapping(
136: Boolean enableMimeContentMapping) {
137: this .enableMimeContentMapping = enableMimeContentMapping;
138: }
139:
140: /**
141: * @return Returns the enableWrapperStyle.
142: */
143: public Boolean isEnableWrapperStyle() {
144: return enableWrapperStyle;
145: }
146:
147: /**
148: * @param enableWrapperStyle The enableWrapperStyle to set.
149: */
150: public void setEnableWrapperStyle(Boolean enableWrapperStyle) {
151: this .enableWrapperStyle = enableWrapperStyle;
152: }
153:
154: /**
155: * @return Returns the jaxwsPackage.
156: */
157: public CustomName getJaxwsPackage() {
158: return jaxwsPackage;
159: }
160:
161: /**
162: * @param jaxwsPackage The jaxwsPackage to set.
163: */
164: public void setJaxwsPackage(CustomName jaxwsPackage) {
165: this .jaxwsPackage = jaxwsPackage;
166: }
167:
168: /**
169: * @return Returns the node.
170: */
171: public String getNode() {
172: return node;
173: }
174:
175: /**
176: * @param node The node to set.
177: */
178: public void setNode(String node) {
179: this .node = node;
180: }
181:
182: /**
183: * @return Returns the version.
184: */
185: public String getVersion() {
186: return version;
187: }
188:
189: /**
190: * @param version The version to set.
191: */
192: public void setVersion(String version) {
193: this .version = version;
194: }
195:
196: /**
197: * @return Returns the wsdlLocation.
198: */
199: public String getWsdlLocation() {
200: return wsdlLocation;
201: }
202:
203: /**
204: * @param wsdlLocation The wsdlLocation to set.
205: */
206: public void setWsdlLocation(String wsdlLocation) {
207: this .wsdlLocation = wsdlLocation;
208: }
209:
210: /**
211: * @return Returns the wsdlNamespace.
212: */
213: public String getWsdlNamespace() {
214: return wsdlNamespace;
215: }
216:
217: /**
218: * @param wsdlNamespace The wsdlNamespace to set.
219: */
220: public void setWsdlNamespace(String wsdlNamespace) {
221: this .wsdlNamespace = wsdlNamespace;
222: }
223:
224: /**
225: * @return Returns the jaxbBindings.
226: */
227: public Set<Element> getJaxbBindings() {
228: return jaxbBindings;
229: }
230:
231: /**
232: * @param jaxbBinding The jaxbBindings to set.
233: */
234: public void addJaxbBindings(Element jaxbBinding) {
235: if (jaxbBindings == null)
236: return;
237: this .jaxbBindings.add(jaxbBinding);
238: }
239:
240: /**
241: * @return the isProvider.
242: */
243: public Boolean isProvider() {
244: return isProvider;
245: }
246:
247: /**
248: * @param isProvider The isProvider to set.
249: */
250: public void setProvider(Boolean isProvider) {
251: this .isProvider = isProvider;
252: }
253:
254: /* (non-Javadoc)
255: * @see Entity#getProperty(java.lang.String)
256: */
257: public Object getProperty(String key) {
258: if (key.equals(JAXWSBindingsConstants.JAXB_BINDINGS))
259: return jaxbBindings;
260: return null;
261: }
262:
263: /**
264: * @return Returns the methodName.
265: */
266: public CustomName getMethodName() {
267: return methodName;
268: }
269:
270: /**
271: * @param methodName The methodName to set.
272: */
273: public void setMethodName(CustomName methodName) {
274: this .methodName = methodName;
275: }
276:
277: /**
278: * @return Returns the parameter.
279: */
280: public Iterator<Parameter> parameters() {
281: return parameters.iterator();
282: }
283:
284: /**
285: * @param parameter The parameter to set.
286: */
287: public void addParameter(Parameter parameter) {
288: if (parameters == null)
289: parameters = new ArrayList<Parameter>();
290: parameters.add(parameter);
291: }
292:
293: public String getParameterName(String msgName, String wsdlPartName,
294: QName element, boolean wrapperStyle) {
295: if (msgName == null || wsdlPartName == null || element == null
296: || parameters == null)
297: return null;
298: for (Parameter param : parameters) {
299: if (param.getMessageName().equals(msgName)
300: && param.getPart().equals(wsdlPartName)) {
301: if (wrapperStyle && (param.getElement() != null)) {
302: if (param.getElement().equals(element))
303: return param.getName();
304: } else if (!wrapperStyle) {
305: return param.getName();
306: }
307: }
308: }
309: return null;
310: }
311:
312: /**
313: * @return Returns the className.
314: */
315: public CustomName getClassName() {
316: return className;
317: }
318:
319: /**
320: * @param className The className to set.
321: */
322: public void setClassName(CustomName className) {
323: this .className = className;
324: }
325:
326: /**
327: * @return Returns the exception.
328: */
329: public Exception getException() {
330: return exception;
331: }
332:
333: /**
334: * @param exception The exception to set.
335: */
336: public void setException(Exception exception) {
337: this .exception = exception;
338: }
339:
340: private String wsdlNamespace;
341: private String wsdlLocation;
342: private String node;
343: private String version;
344:
345: private CustomName jaxwsPackage;
346: private List<Parameter> parameters;
347: private Boolean enableWrapperStyle;
348: private Boolean enableAsyncMapping;
349: // private Boolean enableAdditionalHeaderMapping;
350: private Boolean enableMimeContentMapping;
351: private Boolean isProvider;
352: private Exception exception;
353:
354: private Set<Element> jaxbBindings;
355:
356: // portType className
357: private CustomName className;
358:
359: //portType WSDLOperation
360: private CustomName methodName;
361: }
|