Wed, 27 Apr 2016 01:27:09 +0800
Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/jaxws/
changeset: 657:d47a47f961ee
tag: jdk8u25-b17
aoqi@0 | 1 | /* |
aoqi@0 | 2 | * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
aoqi@0 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
aoqi@0 | 4 | * |
aoqi@0 | 5 | * This code is free software; you can redistribute it and/or modify it |
aoqi@0 | 6 | * under the terms of the GNU General Public License version 2 only, as |
aoqi@0 | 7 | * published by the Free Software Foundation. Oracle designates this |
aoqi@0 | 8 | * particular file as subject to the "Classpath" exception as provided |
aoqi@0 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
aoqi@0 | 10 | * |
aoqi@0 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
aoqi@0 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
aoqi@0 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
aoqi@0 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
aoqi@0 | 15 | * accompanied this code). |
aoqi@0 | 16 | * |
aoqi@0 | 17 | * You should have received a copy of the GNU General Public License version |
aoqi@0 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
aoqi@0 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
aoqi@0 | 20 | * |
aoqi@0 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
aoqi@0 | 22 | * or visit www.oracle.com if you need additional information or have any |
aoqi@0 | 23 | * questions. |
aoqi@0 | 24 | */ |
aoqi@0 | 25 | |
aoqi@0 | 26 | package com.sun.tools.internal.ws.api.wsdl; |
aoqi@0 | 27 | |
aoqi@0 | 28 | import com.sun.tools.internal.ws.wsdl.document.WSDLConstants; |
aoqi@0 | 29 | import org.w3c.dom.Element; |
aoqi@0 | 30 | |
aoqi@0 | 31 | /** |
aoqi@0 | 32 | * JAXWS WSDL parser {@link com.sun.tools.internal.ws.wsdl.parser.WSDLParser} will call an {@link TWSDLExtensionHandler} registered |
aoqi@0 | 33 | * with it for the WSDL extensibility elements thats not already defined in the WSDL 1.1 spec, such as SOAP or MIME. |
aoqi@0 | 34 | * |
aoqi@0 | 35 | * @author Vivek Pandey |
aoqi@0 | 36 | * @deprecated This class is deprecated, will be removed in JAX-WS 2.2 RI. |
aoqi@0 | 37 | */ |
aoqi@0 | 38 | public abstract class TWSDLExtensionHandler { |
aoqi@0 | 39 | /** |
aoqi@0 | 40 | * Gives the namespace of an extensibility element. |
aoqi@0 | 41 | * <p/> |
aoqi@0 | 42 | * For example a soap 1.1 XXExtensionHandler would return <code>""http://schemas.xmlsoap.org/wsdl/soap/"</code> |
aoqi@0 | 43 | */ |
aoqi@0 | 44 | public String getNamespaceURI() { |
aoqi@0 | 45 | return null; |
aoqi@0 | 46 | } |
aoqi@0 | 47 | |
aoqi@0 | 48 | /** |
aoqi@0 | 49 | * This interface is called during WSDL parsing on detecting any wsdl extension. |
aoqi@0 | 50 | * |
aoqi@0 | 51 | * @param context Parser context that will be passed on by the wsdl parser |
aoqi@0 | 52 | * @param parent The Parent element within which the extensibility element is defined |
aoqi@0 | 53 | * @param e The extensibility elemenet |
aoqi@0 | 54 | * @return false if there was some error during the extension handling otherwise returns true. If returned false |
aoqi@0 | 55 | * then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true |
aoqi@0 | 56 | */ |
aoqi@0 | 57 | public boolean doHandleExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
aoqi@0 | 58 | if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_DEFINITIONS)) { |
aoqi@0 | 59 | return handleDefinitionsExtension(context, parent, e); |
aoqi@0 | 60 | } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_TYPES)) { |
aoqi@0 | 61 | return handleTypesExtension(context, parent, e); |
aoqi@0 | 62 | } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_PORT_TYPE)) { |
aoqi@0 | 63 | return handlePortTypeExtension(context, parent, e); |
aoqi@0 | 64 | } else if ( |
aoqi@0 | 65 | parent.getWSDLElementName().equals(WSDLConstants.QNAME_BINDING)) { |
aoqi@0 | 66 | return handleBindingExtension(context, parent, e); |
aoqi@0 | 67 | } else if ( |
aoqi@0 | 68 | parent.getWSDLElementName().equals(WSDLConstants.QNAME_OPERATION)) { |
aoqi@0 | 69 | return handleOperationExtension(context, parent, e); |
aoqi@0 | 70 | } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_INPUT)) { |
aoqi@0 | 71 | return handleInputExtension(context, parent, e); |
aoqi@0 | 72 | } else if ( |
aoqi@0 | 73 | parent.getWSDLElementName().equals(WSDLConstants.QNAME_OUTPUT)) { |
aoqi@0 | 74 | return handleOutputExtension(context, parent, e); |
aoqi@0 | 75 | } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_FAULT)) { |
aoqi@0 | 76 | return handleFaultExtension(context, parent, e); |
aoqi@0 | 77 | } else if ( |
aoqi@0 | 78 | parent.getWSDLElementName().equals(WSDLConstants.QNAME_SERVICE)) { |
aoqi@0 | 79 | return handleServiceExtension(context, parent, e); |
aoqi@0 | 80 | } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_PORT)) { |
aoqi@0 | 81 | return handlePortExtension(context, parent, e); |
aoqi@0 | 82 | } else { |
aoqi@0 | 83 | return false; |
aoqi@0 | 84 | } |
aoqi@0 | 85 | } |
aoqi@0 | 86 | |
aoqi@0 | 87 | /** |
aoqi@0 | 88 | * Callback for <code>wsdl:portType</code> |
aoqi@0 | 89 | * |
aoqi@0 | 90 | * @param context Parser context that will be passed on by the wsdl parser |
aoqi@0 | 91 | * @param parent The Parent element within which the extensibility element is defined |
aoqi@0 | 92 | * @param e The extensibility elemenet |
aoqi@0 | 93 | * @return false if there was some error during the extension handling otherwise returns true. If returned false |
aoqi@0 | 94 | * then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true |
aoqi@0 | 95 | */ |
aoqi@0 | 96 | public boolean handlePortTypeExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
aoqi@0 | 97 | return false; |
aoqi@0 | 98 | } |
aoqi@0 | 99 | |
aoqi@0 | 100 | /** |
aoqi@0 | 101 | * Callback for <code>wsdl:definitions</code> |
aoqi@0 | 102 | * |
aoqi@0 | 103 | * @param context Parser context that will be passed on by the wsdl parser |
aoqi@0 | 104 | * @param parent The Parent element within which the extensibility element is defined |
aoqi@0 | 105 | * @param e The extensibility elemenet |
aoqi@0 | 106 | * @return false if there was some error during the extension handling otherwise returns true. If returned false |
aoqi@0 | 107 | * then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true |
aoqi@0 | 108 | */ |
aoqi@0 | 109 | public boolean handleDefinitionsExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
aoqi@0 | 110 | return false; |
aoqi@0 | 111 | } |
aoqi@0 | 112 | |
aoqi@0 | 113 | /** |
aoqi@0 | 114 | * Callback for <code>wsdl:type</code> |
aoqi@0 | 115 | * |
aoqi@0 | 116 | * @param context Parser context that will be passed on by the wsdl parser |
aoqi@0 | 117 | * @param parent The Parent element within which the extensibility element is defined |
aoqi@0 | 118 | * @param e The extensibility elemenet |
aoqi@0 | 119 | * @return false if there was some error during the extension handling otherwise returns true. If returned false |
aoqi@0 | 120 | * then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true |
aoqi@0 | 121 | */ |
aoqi@0 | 122 | public boolean handleTypesExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
aoqi@0 | 123 | return false; |
aoqi@0 | 124 | } |
aoqi@0 | 125 | |
aoqi@0 | 126 | /** |
aoqi@0 | 127 | * Callback for <code>wsdl:binding</code> |
aoqi@0 | 128 | * |
aoqi@0 | 129 | * @param context Parser context that will be passed on by the wsdl parser |
aoqi@0 | 130 | * @param parent The Parent element within which the extensibility element is defined |
aoqi@0 | 131 | * @param e The extensibility elemenet |
aoqi@0 | 132 | * @return false if there was some error during the extension handling otherwise returns true. If returned false |
aoqi@0 | 133 | * then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true |
aoqi@0 | 134 | */ |
aoqi@0 | 135 | public boolean handleBindingExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
aoqi@0 | 136 | return false; |
aoqi@0 | 137 | } |
aoqi@0 | 138 | |
aoqi@0 | 139 | /** |
aoqi@0 | 140 | * Callback for <code>wsdl:portType/wsdl:operation</code>. |
aoqi@0 | 141 | * |
aoqi@0 | 142 | * @param context Parser context that will be passed on by the wsdl parser |
aoqi@0 | 143 | * @param parent The Parent element within which the extensibility element is defined |
aoqi@0 | 144 | * @param e The extensibility elemenet |
aoqi@0 | 145 | * @return false if there was some error during the extension handling otherwise returns true. If returned false |
aoqi@0 | 146 | * then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true |
aoqi@0 | 147 | */ |
aoqi@0 | 148 | public boolean handleOperationExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
aoqi@0 | 149 | return false; |
aoqi@0 | 150 | } |
aoqi@0 | 151 | |
aoqi@0 | 152 | /** |
aoqi@0 | 153 | * Callback for <code>wsdl:input</code> |
aoqi@0 | 154 | * |
aoqi@0 | 155 | * @param context Parser context that will be passed on by the wsdl parser |
aoqi@0 | 156 | * @param parent The Parent element within which the extensibility element is defined |
aoqi@0 | 157 | * @param e The extensibility elemenet |
aoqi@0 | 158 | * @return false if there was some error during the extension handling otherwise returns true. If returned false |
aoqi@0 | 159 | * then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true |
aoqi@0 | 160 | */ |
aoqi@0 | 161 | public boolean handleInputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
aoqi@0 | 162 | return false; |
aoqi@0 | 163 | } |
aoqi@0 | 164 | |
aoqi@0 | 165 | /** |
aoqi@0 | 166 | * Callback for <code>wsdl:output</code> |
aoqi@0 | 167 | * |
aoqi@0 | 168 | * @param context Parser context that will be passed on by the wsdl parser |
aoqi@0 | 169 | * @param parent The Parent element within which the extensibility element is defined |
aoqi@0 | 170 | * @param e The extensibility elemenet |
aoqi@0 | 171 | * @return false if there was some error during the extension handling otherwise returns true. If returned false |
aoqi@0 | 172 | * then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true |
aoqi@0 | 173 | */ |
aoqi@0 | 174 | public boolean handleOutputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
aoqi@0 | 175 | return false; |
aoqi@0 | 176 | } |
aoqi@0 | 177 | |
aoqi@0 | 178 | /** |
aoqi@0 | 179 | * Callback for <code>wsdl:fault</code> |
aoqi@0 | 180 | * |
aoqi@0 | 181 | * @param context Parser context that will be passed on by the wsdl parser |
aoqi@0 | 182 | * @param parent The Parent element within which the extensibility element is defined |
aoqi@0 | 183 | * @param e The extensibility elemenet |
aoqi@0 | 184 | * @return false if there was some error during the extension handling otherwise returns true. If returned false |
aoqi@0 | 185 | * then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true |
aoqi@0 | 186 | */ |
aoqi@0 | 187 | public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
aoqi@0 | 188 | return false; |
aoqi@0 | 189 | } |
aoqi@0 | 190 | |
aoqi@0 | 191 | /** |
aoqi@0 | 192 | * Callback for <code>wsdl:service</code> |
aoqi@0 | 193 | * |
aoqi@0 | 194 | * @param context Parser context that will be passed on by the wsdl parser |
aoqi@0 | 195 | * @param parent The Parent element within which the extensibility element is defined |
aoqi@0 | 196 | * @param e The extensibility elemenet |
aoqi@0 | 197 | * @return false if there was some error during the extension handling otherwise returns true. If returned false |
aoqi@0 | 198 | * then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true |
aoqi@0 | 199 | */ |
aoqi@0 | 200 | public boolean handleServiceExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
aoqi@0 | 201 | return false; |
aoqi@0 | 202 | } |
aoqi@0 | 203 | |
aoqi@0 | 204 | /** |
aoqi@0 | 205 | * Callback for <code>wsdl:port</code> |
aoqi@0 | 206 | * |
aoqi@0 | 207 | * @param context Parser context that will be passed on by the wsdl parser |
aoqi@0 | 208 | * @param parent The Parent element within which the extensibility element is defined |
aoqi@0 | 209 | * @param e The extensibility elemenet |
aoqi@0 | 210 | * @return false if there was some error during the extension handling otherwise returns true. If returned false |
aoqi@0 | 211 | * then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true |
aoqi@0 | 212 | */ |
aoqi@0 | 213 | public boolean handlePortExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
aoqi@0 | 214 | return false; |
aoqi@0 | 215 | } |
aoqi@0 | 216 | } |