Tue, 06 Mar 2012 16:09:35 -0800
7150322: Stop using drop source bundles in jaxws
Reviewed-by: darcy, ohrstrom
1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
26 package com.sun.xml.internal.ws.wsdl.parser;
28 import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
29 import com.sun.xml.internal.ws.developer.MemberSubmissionAddressingFeature;
30 import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
31 import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType;
32 import com.sun.xml.internal.ws.api.model.wsdl.WSDLFeaturedObject;
33 import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
34 import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
35 import com.sun.xml.internal.ws.model.wsdl.WSDLBoundPortTypeImpl;
36 import com.sun.xml.internal.ws.model.wsdl.WSDLOperationImpl;
37 import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
39 import javax.xml.namespace.QName;
40 import javax.xml.stream.XMLStreamReader;
42 /**
43 * Member Submission WS-Addressing Runtime WSDL parser extension
44 *
45 * @author Arun Gupta
46 */
47 public class MemberSubmissionAddressingWSDLParserExtension extends W3CAddressingWSDLParserExtension {
48 @Override
49 public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader) {
50 return addressibleElement(reader, binding);
51 }
53 @Override
54 public boolean portElements(WSDLPort port, XMLStreamReader reader) {
55 return addressibleElement(reader, port);
56 }
58 private boolean addressibleElement(XMLStreamReader reader, WSDLFeaturedObject binding) {
59 QName ua = reader.getName();
60 if (ua.equals(AddressingVersion.MEMBER.wsdlExtensionTag)) {
61 String required = reader.getAttributeValue(WSDLConstants.NS_WSDL, "required");
62 binding.addFeature(new MemberSubmissionAddressingFeature(Boolean.parseBoolean(required)));
63 XMLStreamReaderUtil.skipElement(reader);
64 return true; // UsingAddressing is consumed
65 }
67 return false;
68 }
70 @Override
71 public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) {
72 return false;
73 }
75 @Override
76 protected void patchAnonymousDefault(WSDLBoundPortTypeImpl binding) {
77 }
79 @Override
80 protected String getNamespaceURI() {
81 return AddressingVersion.MEMBER.wsdlNsUri;
82 }
84 @Override
85 protected QName getWsdlActionTag() {
86 return AddressingVersion.MEMBER.wsdlActionTag;
87 }
88 }