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, 2013, 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.xml.internal.ws.api.wsdl.writer; |
aoqi@0 | 27 | |
aoqi@0 | 28 | import com.sun.istack.internal.NotNull; |
aoqi@0 | 29 | import com.sun.xml.internal.txw2.TypedXmlWriter; |
aoqi@0 | 30 | import com.sun.xml.internal.ws.api.WSBinding; |
aoqi@0 | 31 | import com.sun.xml.internal.ws.api.model.CheckedException; |
aoqi@0 | 32 | import com.sun.xml.internal.ws.api.model.JavaMethod; |
aoqi@0 | 33 | import com.sun.xml.internal.ws.api.model.SEIModel; |
aoqi@0 | 34 | import com.sun.xml.internal.ws.api.server.Container; |
aoqi@0 | 35 | import com.sun.xml.internal.ws.api.server.WSEndpoint; |
aoqi@0 | 36 | |
aoqi@0 | 37 | /** |
aoqi@0 | 38 | * This is a callback interface used to extend the WSDLGenerator. Implementors |
aoqi@0 | 39 | * of this interface can add their own WSDL extensions to the generated WSDL. |
aoqi@0 | 40 | * There are a number of methods that will be invoked allowing the extensions |
aoqi@0 | 41 | * to be generated on various WSDL elements. |
aoqi@0 | 42 | * <p/> |
aoqi@0 | 43 | * The JAX-WS WSDLGenerator uses TXW to serialize the WSDL out to XML. |
aoqi@0 | 44 | * More information about TXW can be located at |
aoqi@0 | 45 | * <a href="http://txw.java.net">http://txw.java.net</a>. |
aoqi@0 | 46 | */ |
aoqi@0 | 47 | public abstract class WSDLGeneratorExtension { |
aoqi@0 | 48 | /** |
aoqi@0 | 49 | * Called at the very beginning of the process. |
aoqi@0 | 50 | * <p/> |
aoqi@0 | 51 | * This method is invoked so that the root element can be manipulated before |
aoqi@0 | 52 | * any tags have been written. This allows to set e.g. namespace prefixes. |
aoqi@0 | 53 | * <p/> |
aoqi@0 | 54 | * Another purpose of this method is to let extensions know what model |
aoqi@0 | 55 | * we are generating a WSDL for. |
aoqi@0 | 56 | * |
aoqi@0 | 57 | * @param root This is the root element of the generated WSDL. |
aoqi@0 | 58 | * @param model WSDL is being generated from this {@link SEIModel}. |
aoqi@0 | 59 | * @param binding The binding for which we generate WSDL. the binding {@link WSBinding} represents a particular |
aoqi@0 | 60 | * configuration of JAXWS. This can be typically be overriden by |
aoqi@0 | 61 | * @param container The entry point to the external environment. |
aoqi@0 | 62 | * If this extension is used at the runtime to generate WSDL, you get a {@link Container} |
aoqi@0 | 63 | * that was given to {@link WSEndpoint#create}. |
aoqi@0 | 64 | * TODO: think about tool side |
aoqi@0 | 65 | * @deprecated |
aoqi@0 | 66 | */ |
aoqi@0 | 67 | public void start(@NotNull TypedXmlWriter root, @NotNull SEIModel model, @NotNull WSBinding binding, @NotNull Container container) { |
aoqi@0 | 68 | } |
aoqi@0 | 69 | |
aoqi@0 | 70 | /** |
aoqi@0 | 71 | * Called before writing </wsdl:defintions>. |
aoqi@0 | 72 | * |
aoqi@0 | 73 | * @param ctxt |
aoqi@0 | 74 | */ |
aoqi@0 | 75 | public void end(@NotNull WSDLGenExtnContext ctxt) { |
aoqi@0 | 76 | } |
aoqi@0 | 77 | |
aoqi@0 | 78 | /** |
aoqi@0 | 79 | * Called at the very beginning of the process. |
aoqi@0 | 80 | * <p/> |
aoqi@0 | 81 | * This method is invoked so that the root element can be manipulated before |
aoqi@0 | 82 | * any tags have been written. This allows to set e.g. namespace prefixes. |
aoqi@0 | 83 | * <p/> |
aoqi@0 | 84 | * Another purpose of this method is to let extensions know what model |
aoqi@0 | 85 | * we are generating a WSDL for. |
aoqi@0 | 86 | * |
aoqi@0 | 87 | * @param ctxt Provides the context for the generator extensions |
aoqi@0 | 88 | */ |
aoqi@0 | 89 | public void start(WSDLGenExtnContext ctxt) { |
aoqi@0 | 90 | } |
aoqi@0 | 91 | |
aoqi@0 | 92 | /** |
aoqi@0 | 93 | * This method is invoked so that extensions to a <code>wsdl:definitions</code> |
aoqi@0 | 94 | * element can be generated. |
aoqi@0 | 95 | * |
aoqi@0 | 96 | * @param definitions This is the <code>wsdl:defintions</code> element that the extension can be added to. |
aoqi@0 | 97 | */ |
aoqi@0 | 98 | public void addDefinitionsExtension(TypedXmlWriter definitions) { |
aoqi@0 | 99 | } |
aoqi@0 | 100 | |
aoqi@0 | 101 | /** |
aoqi@0 | 102 | * This method is invoked so that extensions to a <code>wsdl:service</code> |
aoqi@0 | 103 | * element can be generated. |
aoqi@0 | 104 | * |
aoqi@0 | 105 | * @param service This is the <code>wsdl:service</code> element that the extension can be added to. |
aoqi@0 | 106 | */ |
aoqi@0 | 107 | public void addServiceExtension(TypedXmlWriter service) { |
aoqi@0 | 108 | } |
aoqi@0 | 109 | |
aoqi@0 | 110 | /** |
aoqi@0 | 111 | * This method is invoked so that extensions to a <code>wsdl:port</code> |
aoqi@0 | 112 | * element can be generated. |
aoqi@0 | 113 | * |
aoqi@0 | 114 | * @param port This is the wsdl:port element that the extension can be added to. |
aoqi@0 | 115 | */ |
aoqi@0 | 116 | public void addPortExtension(TypedXmlWriter port) { |
aoqi@0 | 117 | } |
aoqi@0 | 118 | |
aoqi@0 | 119 | /** |
aoqi@0 | 120 | * This method is invoked so that extensions to a <code>wsdl:portType</code> |
aoqi@0 | 121 | * element can be generated. |
aoqi@0 | 122 | * <p/> |
aoqi@0 | 123 | * |
aoqi@0 | 124 | * @param portType This is the wsdl:portType element that the extension can be added to. |
aoqi@0 | 125 | */ |
aoqi@0 | 126 | public void addPortTypeExtension(TypedXmlWriter portType) { |
aoqi@0 | 127 | } |
aoqi@0 | 128 | |
aoqi@0 | 129 | /** |
aoqi@0 | 130 | * This method is invoked so that extensions to a <code>wsdl:binding</code> |
aoqi@0 | 131 | * element can be generated. |
aoqi@0 | 132 | * <p/> |
aoqi@0 | 133 | * <p/> |
aoqi@0 | 134 | * TODO: Some other information may need to be passed |
aoqi@0 | 135 | * |
aoqi@0 | 136 | * @param binding This is the wsdl:binding element that the extension can be added to. |
aoqi@0 | 137 | */ |
aoqi@0 | 138 | public void addBindingExtension(TypedXmlWriter binding) { |
aoqi@0 | 139 | } |
aoqi@0 | 140 | |
aoqi@0 | 141 | /** |
aoqi@0 | 142 | * This method is invoked so that extensions to a <code>wsdl:portType/wsdl:operation</code> |
aoqi@0 | 143 | * element can be generated. |
aoqi@0 | 144 | * |
aoqi@0 | 145 | * @param operation This is the wsdl:portType/wsdl:operation element that the |
aoqi@0 | 146 | * extension can be added to. |
aoqi@0 | 147 | * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation |
aoqi@0 | 148 | */ |
aoqi@0 | 149 | public void addOperationExtension(TypedXmlWriter operation, JavaMethod method) { |
aoqi@0 | 150 | } |
aoqi@0 | 151 | |
aoqi@0 | 152 | |
aoqi@0 | 153 | /** |
aoqi@0 | 154 | * This method is invoked so that extensions to a <code>wsdl:binding/wsdl:operation</code> |
aoqi@0 | 155 | * element can be generated. |
aoqi@0 | 156 | * |
aoqi@0 | 157 | * @param operation This is the wsdl:binding/wsdl:operation element that the |
aoqi@0 | 158 | * extension can be added to. |
aoqi@0 | 159 | * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation |
aoqi@0 | 160 | */ |
aoqi@0 | 161 | public void addBindingOperationExtension(TypedXmlWriter operation, JavaMethod method) { |
aoqi@0 | 162 | } |
aoqi@0 | 163 | |
aoqi@0 | 164 | /** |
aoqi@0 | 165 | * This method is invoked so that extensions to an input <code>wsdl:message</code> |
aoqi@0 | 166 | * element can be generated. |
aoqi@0 | 167 | * |
aoqi@0 | 168 | * @param message This is the input wsdl:message element that the |
aoqi@0 | 169 | * extension can be added to. |
aoqi@0 | 170 | * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation |
aoqi@0 | 171 | */ |
aoqi@0 | 172 | public void addInputMessageExtension(TypedXmlWriter message, JavaMethod method) { |
aoqi@0 | 173 | } |
aoqi@0 | 174 | |
aoqi@0 | 175 | /** |
aoqi@0 | 176 | * This method is invoked so that extensions to an output <code>wsdl:message</code> |
aoqi@0 | 177 | * element can be generated. |
aoqi@0 | 178 | * |
aoqi@0 | 179 | * @param message This is the output wsdl:message element that the |
aoqi@0 | 180 | * extension can be added to. |
aoqi@0 | 181 | * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation |
aoqi@0 | 182 | */ |
aoqi@0 | 183 | public void addOutputMessageExtension(TypedXmlWriter message, JavaMethod method) { |
aoqi@0 | 184 | } |
aoqi@0 | 185 | |
aoqi@0 | 186 | |
aoqi@0 | 187 | /** |
aoqi@0 | 188 | * This method is invoked so that extensions to a |
aoqi@0 | 189 | * <code>wsdl:portType/wsdl:operation/wsdl:input</code> |
aoqi@0 | 190 | * element can be generated. |
aoqi@0 | 191 | * |
aoqi@0 | 192 | * @param input This is the wsdl:portType/wsdl:operation/wsdl:input element that the |
aoqi@0 | 193 | * extension can be added to. |
aoqi@0 | 194 | * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation |
aoqi@0 | 195 | */ |
aoqi@0 | 196 | public void addOperationInputExtension(TypedXmlWriter input, JavaMethod method) { |
aoqi@0 | 197 | } |
aoqi@0 | 198 | |
aoqi@0 | 199 | |
aoqi@0 | 200 | /** |
aoqi@0 | 201 | * This method is invoked so that extensions to a <code>wsdl:portType/wsdl:operation/wsdl:output</code> |
aoqi@0 | 202 | * element can be generated. |
aoqi@0 | 203 | * |
aoqi@0 | 204 | * @param output This is the wsdl:portType/wsdl:operation/wsdl:output element that the |
aoqi@0 | 205 | * extension can be added to. |
aoqi@0 | 206 | * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation |
aoqi@0 | 207 | */ |
aoqi@0 | 208 | public void addOperationOutputExtension(TypedXmlWriter output, JavaMethod method) { |
aoqi@0 | 209 | } |
aoqi@0 | 210 | |
aoqi@0 | 211 | /** |
aoqi@0 | 212 | * This method is invoked so that extensions to a |
aoqi@0 | 213 | * <code>wsdl:binding/wsdl:operation/wsdl:input</code> |
aoqi@0 | 214 | * element can be generated. |
aoqi@0 | 215 | * |
aoqi@0 | 216 | * @param input This is the wsdl:binding/wsdl:operation/wsdl:input element that the |
aoqi@0 | 217 | * extension can be added to. |
aoqi@0 | 218 | * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation |
aoqi@0 | 219 | */ |
aoqi@0 | 220 | public void addBindingOperationInputExtension(TypedXmlWriter input, JavaMethod method) { |
aoqi@0 | 221 | } |
aoqi@0 | 222 | |
aoqi@0 | 223 | |
aoqi@0 | 224 | /** |
aoqi@0 | 225 | * This method is invoked so that extensions to a <code>wsdl:binding/wsdl:operation/wsdl:output</code> |
aoqi@0 | 226 | * element can be generated. |
aoqi@0 | 227 | * |
aoqi@0 | 228 | * @param output This is the wsdl:binding/wsdl:operation/wsdl:output element that the |
aoqi@0 | 229 | * extension can be added to. |
aoqi@0 | 230 | * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation |
aoqi@0 | 231 | */ |
aoqi@0 | 232 | public void addBindingOperationOutputExtension(TypedXmlWriter output, JavaMethod method) { |
aoqi@0 | 233 | } |
aoqi@0 | 234 | |
aoqi@0 | 235 | /** |
aoqi@0 | 236 | * This method is invoked so that extensions to a <code>wsdl:binding/wsdl:operation/wsdl:fault</code> |
aoqi@0 | 237 | * element can be generated. |
aoqi@0 | 238 | * |
aoqi@0 | 239 | * @param fault This is the wsdl:binding/wsdl:operation/wsdl:fault or wsdl:portType/wsdl:output/wsdl:operation/wsdl:fault |
aoqi@0 | 240 | * element that the extension can be added to. |
aoqi@0 | 241 | * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation |
aoqi@0 | 242 | */ |
aoqi@0 | 243 | public void addBindingOperationFaultExtension(TypedXmlWriter fault, JavaMethod method, CheckedException ce) { |
aoqi@0 | 244 | } |
aoqi@0 | 245 | |
aoqi@0 | 246 | /** |
aoqi@0 | 247 | * This method is invoked so that extensions to a <code>wsdl:portType/wsdl:operation/wsdl:fault</code> |
aoqi@0 | 248 | * element can be generated. |
aoqi@0 | 249 | * |
aoqi@0 | 250 | * @param message This is the fault wsdl:message element that the |
aoqi@0 | 251 | * extension can be added to. |
aoqi@0 | 252 | * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation |
aoqi@0 | 253 | * |
aoqi@0 | 254 | * @param ce {@link CheckedException} that abstracts wsdl:fault |
aoqi@0 | 255 | */ |
aoqi@0 | 256 | public void addFaultMessageExtension(TypedXmlWriter message, JavaMethod method, CheckedException ce) { |
aoqi@0 | 257 | } |
aoqi@0 | 258 | |
aoqi@0 | 259 | /** |
aoqi@0 | 260 | * This method is invoked so that extensions to a <code>wsdl:portType/wsdl:operation/wsdl:fault</code> |
aoqi@0 | 261 | * element can be generated. |
aoqi@0 | 262 | * |
aoqi@0 | 263 | * @param fault This is the wsdl:portType/wsdl:operation/wsdl:fault element that the |
aoqi@0 | 264 | * extension can be added to. |
aoqi@0 | 265 | * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation |
aoqi@0 | 266 | * @param ce {@link CheckedException} that abstracts wsdl:fault |
aoqi@0 | 267 | */ |
aoqi@0 | 268 | public void addOperationFaultExtension(TypedXmlWriter fault, JavaMethod method, CheckedException ce) { |
aoqi@0 | 269 | } |
aoqi@0 | 270 | |
aoqi@0 | 271 | } |