src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/writer/WSDLGeneratorExtension.java

Tue, 09 Apr 2013 14:51:13 +0100

author
alanb
date
Tue, 09 Apr 2013 14:51:13 +0100
changeset 368
0989ad8c0860
parent 286
f50545b5e2f1
child 397
b99d7e355d4b
permissions
-rw-r--r--

8010393: Update JAX-WS RI to 2.2.9-b12941
Reviewed-by: alanb, erikj
Contributed-by: miroslav.kos@oracle.com, martin.grebac@oracle.com

ohair@286 1 /*
alanb@368 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
ohair@286 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@286 4 *
ohair@286 5 * This code is free software; you can redistribute it and/or modify it
ohair@286 6 * under the terms of the GNU General Public License version 2 only, as
ohair@286 7 * published by the Free Software Foundation. Oracle designates this
ohair@286 8 * particular file as subject to the "Classpath" exception as provided
ohair@286 9 * by Oracle in the LICENSE file that accompanied this code.
ohair@286 10 *
ohair@286 11 * This code is distributed in the hope that it will be useful, but WITHOUT
ohair@286 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@286 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@286 14 * version 2 for more details (a copy is included in the LICENSE file that
ohair@286 15 * accompanied this code).
ohair@286 16 *
ohair@286 17 * You should have received a copy of the GNU General Public License version
ohair@286 18 * 2 along with this work; if not, write to the Free Software Foundation,
ohair@286 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@286 20 *
ohair@286 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@286 22 * or visit www.oracle.com if you need additional information or have any
ohair@286 23 * questions.
ohair@286 24 */
ohair@286 25
ohair@286 26 package com.sun.xml.internal.ws.api.wsdl.writer;
ohair@286 27
ohair@286 28 import com.sun.istack.internal.NotNull;
ohair@286 29 import com.sun.xml.internal.txw2.TypedXmlWriter;
ohair@286 30 import com.sun.xml.internal.ws.api.WSBinding;
ohair@286 31 import com.sun.xml.internal.ws.api.model.CheckedException;
ohair@286 32 import com.sun.xml.internal.ws.api.model.JavaMethod;
ohair@286 33 import com.sun.xml.internal.ws.api.model.SEIModel;
ohair@286 34 import com.sun.xml.internal.ws.api.server.Container;
ohair@286 35 import com.sun.xml.internal.ws.api.server.WSEndpoint;
ohair@286 36
ohair@286 37 /**
ohair@286 38 * This is a callback interface used to extend the WSDLGenerator. Implementors
ohair@286 39 * of this interface can add their own WSDL extensions to the generated WSDL.
ohair@286 40 * There are a number of methods that will be invoked allowing the extensions
ohair@286 41 * to be generated on various WSDL elements.
ohair@286 42 * <p/>
ohair@286 43 * The JAX-WS WSDLGenerator uses TXW to serialize the WSDL out to XML.
ohair@286 44 * More information about TXW can be located at
ohair@286 45 * <a href="http://txw.dev.java.net">http://txw.dev.java.net</a>.
ohair@286 46 */
ohair@286 47 public abstract class WSDLGeneratorExtension {
ohair@286 48 /**
ohair@286 49 * Called at the very beginning of the process.
ohair@286 50 * <p/>
ohair@286 51 * This method is invoked so that the root element can be manipulated before
ohair@286 52 * any tags have been written. This allows to set e.g. namespace prefixes.
ohair@286 53 * <p/>
ohair@286 54 * Another purpose of this method is to let extensions know what model
ohair@286 55 * we are generating a WSDL for.
ohair@286 56 *
ohair@286 57 * @param root This is the root element of the generated WSDL.
ohair@286 58 * @param model WSDL is being generated from this {@link SEIModel}.
ohair@286 59 * @param binding The binding for which we generate WSDL. the binding {@link WSBinding} represents a particular
ohair@286 60 * configuration of JAXWS. This can be typically be overriden by
ohair@286 61 * @param container The entry point to the external environment.
ohair@286 62 * If this extension is used at the runtime to generate WSDL, you get a {@link Container}
ohair@286 63 * that was given to {@link WSEndpoint#create}.
ohair@286 64 * TODO: think about tool side
ohair@286 65 * @deprecated
ohair@286 66 */
ohair@286 67 public void start(@NotNull TypedXmlWriter root, @NotNull SEIModel model, @NotNull WSBinding binding, @NotNull Container container) {
ohair@286 68 }
ohair@286 69
ohair@286 70 /**
ohair@286 71 * Called before writing </wsdl:defintions>.
ohair@286 72 *
ohair@286 73 * @param ctxt
ohair@286 74 */
ohair@286 75 public void end(@NotNull WSDLGenExtnContext ctxt) {
ohair@286 76 }
ohair@286 77
ohair@286 78 /**
ohair@286 79 * Called at the very beginning of the process.
ohair@286 80 * <p/>
ohair@286 81 * This method is invoked so that the root element can be manipulated before
ohair@286 82 * any tags have been written. This allows to set e.g. namespace prefixes.
ohair@286 83 * <p/>
ohair@286 84 * Another purpose of this method is to let extensions know what model
ohair@286 85 * we are generating a WSDL for.
ohair@286 86 *
ohair@286 87 * @param ctxt Provides the context for the generator extensions
ohair@286 88 */
ohair@286 89 public void start(WSDLGenExtnContext ctxt) {
ohair@286 90 }
ohair@286 91
ohair@286 92 /**
ohair@286 93 * This method is invoked so that extensions to a <code>wsdl:definitions</code>
ohair@286 94 * element can be generated.
ohair@286 95 *
ohair@286 96 * @param definitions This is the <code>wsdl:defintions</code> element that the extension can be added to.
ohair@286 97 */
ohair@286 98 public void addDefinitionsExtension(TypedXmlWriter definitions) {
ohair@286 99 }
ohair@286 100
ohair@286 101 /**
ohair@286 102 * This method is invoked so that extensions to a <code>wsdl:service</code>
ohair@286 103 * element can be generated.
ohair@286 104 *
ohair@286 105 * @param service This is the <code>wsdl:service</code> element that the extension can be added to.
ohair@286 106 */
ohair@286 107 public void addServiceExtension(TypedXmlWriter service) {
ohair@286 108 }
ohair@286 109
ohair@286 110 /**
ohair@286 111 * This method is invoked so that extensions to a <code>wsdl:port</code>
ohair@286 112 * element can be generated.
ohair@286 113 *
ohair@286 114 * @param port This is the wsdl:port element that the extension can be added to.
ohair@286 115 */
ohair@286 116 public void addPortExtension(TypedXmlWriter port) {
ohair@286 117 }
ohair@286 118
ohair@286 119 /**
ohair@286 120 * This method is invoked so that extensions to a <code>wsdl:portType</code>
ohair@286 121 * element can be generated.
ohair@286 122 * <p/>
ohair@286 123 *
ohair@286 124 * @param portType This is the wsdl:portType element that the extension can be added to.
ohair@286 125 */
ohair@286 126 public void addPortTypeExtension(TypedXmlWriter portType) {
ohair@286 127 }
ohair@286 128
ohair@286 129 /**
ohair@286 130 * This method is invoked so that extensions to a <code>wsdl:binding</code>
ohair@286 131 * element can be generated.
ohair@286 132 * <p/>
ohair@286 133 * <p/>
ohair@286 134 * TODO: Some other information may need to be passed
ohair@286 135 *
ohair@286 136 * @param binding This is the wsdl:binding element that the extension can be added to.
ohair@286 137 */
ohair@286 138 public void addBindingExtension(TypedXmlWriter binding) {
ohair@286 139 }
ohair@286 140
ohair@286 141 /**
ohair@286 142 * This method is invoked so that extensions to a <code>wsdl:portType/wsdl:operation</code>
ohair@286 143 * element can be generated.
ohair@286 144 *
ohair@286 145 * @param operation This is the wsdl:portType/wsdl:operation element that the
ohair@286 146 * extension can be added to.
ohair@286 147 * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
ohair@286 148 */
ohair@286 149 public void addOperationExtension(TypedXmlWriter operation, JavaMethod method) {
ohair@286 150 }
ohair@286 151
ohair@286 152
ohair@286 153 /**
ohair@286 154 * This method is invoked so that extensions to a <code>wsdl:binding/wsdl:operation</code>
ohair@286 155 * element can be generated.
ohair@286 156 *
ohair@286 157 * @param operation This is the wsdl:binding/wsdl:operation element that the
ohair@286 158 * extension can be added to.
ohair@286 159 * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
ohair@286 160 */
ohair@286 161 public void addBindingOperationExtension(TypedXmlWriter operation, JavaMethod method) {
ohair@286 162 }
ohair@286 163
ohair@286 164 /**
ohair@286 165 * This method is invoked so that extensions to an input <code>wsdl:message</code>
ohair@286 166 * element can be generated.
ohair@286 167 *
ohair@286 168 * @param message This is the input wsdl:message element that the
ohair@286 169 * extension can be added to.
ohair@286 170 * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
ohair@286 171 */
ohair@286 172 public void addInputMessageExtension(TypedXmlWriter message, JavaMethod method) {
ohair@286 173 }
ohair@286 174
ohair@286 175 /**
ohair@286 176 * This method is invoked so that extensions to an output <code>wsdl:message</code>
ohair@286 177 * element can be generated.
ohair@286 178 *
ohair@286 179 * @param message This is the output wsdl:message element that the
ohair@286 180 * extension can be added to.
ohair@286 181 * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
ohair@286 182 */
ohair@286 183 public void addOutputMessageExtension(TypedXmlWriter message, JavaMethod method) {
ohair@286 184 }
ohair@286 185
ohair@286 186
ohair@286 187 /**
ohair@286 188 * This method is invoked so that extensions to a
ohair@286 189 * <code>wsdl:portType/wsdl:operation/wsdl:input</code>
ohair@286 190 * element can be generated.
ohair@286 191 *
ohair@286 192 * @param input This is the wsdl:portType/wsdl:operation/wsdl:input element that the
ohair@286 193 * extension can be added to.
ohair@286 194 * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
ohair@286 195 */
ohair@286 196 public void addOperationInputExtension(TypedXmlWriter input, JavaMethod method) {
ohair@286 197 }
ohair@286 198
ohair@286 199
ohair@286 200 /**
ohair@286 201 * This method is invoked so that extensions to a <code>wsdl:portType/wsdl:operation/wsdl:output</code>
ohair@286 202 * element can be generated.
ohair@286 203 *
ohair@286 204 * @param output This is the wsdl:portType/wsdl:operation/wsdl:output element that the
ohair@286 205 * extension can be added to.
ohair@286 206 * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
ohair@286 207 */
ohair@286 208 public void addOperationOutputExtension(TypedXmlWriter output, JavaMethod method) {
ohair@286 209 }
ohair@286 210
ohair@286 211 /**
ohair@286 212 * This method is invoked so that extensions to a
ohair@286 213 * <code>wsdl:binding/wsdl:operation/wsdl:input</code>
ohair@286 214 * element can be generated.
ohair@286 215 *
ohair@286 216 * @param input This is the wsdl:binding/wsdl:operation/wsdl:input element that the
ohair@286 217 * extension can be added to.
ohair@286 218 * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
ohair@286 219 */
ohair@286 220 public void addBindingOperationInputExtension(TypedXmlWriter input, JavaMethod method) {
ohair@286 221 }
ohair@286 222
ohair@286 223
ohair@286 224 /**
ohair@286 225 * This method is invoked so that extensions to a <code>wsdl:binding/wsdl:operation/wsdl:output</code>
ohair@286 226 * element can be generated.
ohair@286 227 *
ohair@286 228 * @param output This is the wsdl:binding/wsdl:operation/wsdl:output element that the
ohair@286 229 * extension can be added to.
ohair@286 230 * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
ohair@286 231 */
ohair@286 232 public void addBindingOperationOutputExtension(TypedXmlWriter output, JavaMethod method) {
ohair@286 233 }
ohair@286 234
ohair@286 235 /**
ohair@286 236 * This method is invoked so that extensions to a <code>wsdl:binding/wsdl:operation/wsdl:fault</code>
ohair@286 237 * element can be generated.
ohair@286 238 *
ohair@286 239 * @param fault This is the wsdl:binding/wsdl:operation/wsdl:fault or wsdl:portType/wsdl:output/wsdl:operation/wsdl:fault
ohair@286 240 * element that the extension can be added to.
ohair@286 241 * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
ohair@286 242 */
ohair@286 243 public void addBindingOperationFaultExtension(TypedXmlWriter fault, JavaMethod method, CheckedException ce) {
ohair@286 244 }
ohair@286 245
ohair@286 246 /**
ohair@286 247 * This method is invoked so that extensions to a <code>wsdl:portType/wsdl:operation/wsdl:fault</code>
ohair@286 248 * element can be generated.
ohair@286 249 *
ohair@286 250 * @param message This is the fault wsdl:message element that the
ohair@286 251 * extension can be added to.
ohair@286 252 * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
ohair@286 253 *
ohair@286 254 * @param ce {@link CheckedException} that abstracts wsdl:fault
ohair@286 255 */
ohair@286 256 public void addFaultMessageExtension(TypedXmlWriter message, JavaMethod method, CheckedException ce) {
ohair@286 257 }
ohair@286 258
ohair@286 259 /**
ohair@286 260 * This method is invoked so that extensions to a <code>wsdl:portType/wsdl:operation/wsdl:fault</code>
ohair@286 261 * element can be generated.
ohair@286 262 *
ohair@286 263 * @param fault This is the wsdl:portType/wsdl:operation/wsdl:fault element that the
ohair@286 264 * extension can be added to.
ohair@286 265 * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
ohair@286 266 * @param ce {@link CheckedException} that abstracts wsdl:fault
ohair@286 267 */
ohair@286 268 public void addOperationFaultExtension(TypedXmlWriter fault, JavaMethod method, CheckedException ce) {
ohair@286 269 }
ohair@286 270
ohair@286 271 }

mercurial