aoqi@0: /* aoqi@0: * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. Oracle designates this aoqi@0: * particular file as subject to the "Classpath" exception as provided aoqi@0: * by Oracle in the LICENSE file that accompanied this code. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: package com.sun.tools.internal.ws.api.wsdl; aoqi@0: aoqi@0: import com.sun.tools.internal.ws.wsdl.document.WSDLConstants; aoqi@0: import org.w3c.dom.Element; aoqi@0: aoqi@0: /** aoqi@0: * JAXWS WSDL parser {@link com.sun.tools.internal.ws.wsdl.parser.WSDLParser} will call an {@link TWSDLExtensionHandler} registered aoqi@0: * with it for the WSDL extensibility elements thats not already defined in the WSDL 1.1 spec, such as SOAP or MIME. aoqi@0: * aoqi@0: * @author Vivek Pandey aoqi@0: * @deprecated This class is deprecated, will be removed in JAX-WS 2.2 RI. aoqi@0: */ aoqi@0: public abstract class TWSDLExtensionHandler { aoqi@0: /** aoqi@0: * Gives the namespace of an extensibility element. aoqi@0: *
aoqi@0: * For example a soap 1.1 XXExtensionHandler would return""http://schemas.xmlsoap.org/wsdl/soap/"
aoqi@0: */
aoqi@0: public String getNamespaceURI() {
aoqi@0: return null;
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * This interface is called during WSDL parsing on detecting any wsdl extension.
aoqi@0: *
aoqi@0: * @param context Parser context that will be passed on by the wsdl parser
aoqi@0: * @param parent The Parent element within which the extensibility element is defined
aoqi@0: * @param e The extensibility elemenet
aoqi@0: * @return false if there was some error during the extension handling otherwise returns true. If returned false
aoqi@0: * then the WSDL parser can abort if the wsdl extensibility element had required
attribute set to true
aoqi@0: */
aoqi@0: public boolean doHandleExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
aoqi@0: if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_DEFINITIONS)) {
aoqi@0: return handleDefinitionsExtension(context, parent, e);
aoqi@0: } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_TYPES)) {
aoqi@0: return handleTypesExtension(context, parent, e);
aoqi@0: } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_PORT_TYPE)) {
aoqi@0: return handlePortTypeExtension(context, parent, e);
aoqi@0: } else if (
aoqi@0: parent.getWSDLElementName().equals(WSDLConstants.QNAME_BINDING)) {
aoqi@0: return handleBindingExtension(context, parent, e);
aoqi@0: } else if (
aoqi@0: parent.getWSDLElementName().equals(WSDLConstants.QNAME_OPERATION)) {
aoqi@0: return handleOperationExtension(context, parent, e);
aoqi@0: } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_INPUT)) {
aoqi@0: return handleInputExtension(context, parent, e);
aoqi@0: } else if (
aoqi@0: parent.getWSDLElementName().equals(WSDLConstants.QNAME_OUTPUT)) {
aoqi@0: return handleOutputExtension(context, parent, e);
aoqi@0: } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_FAULT)) {
aoqi@0: return handleFaultExtension(context, parent, e);
aoqi@0: } else if (
aoqi@0: parent.getWSDLElementName().equals(WSDLConstants.QNAME_SERVICE)) {
aoqi@0: return handleServiceExtension(context, parent, e);
aoqi@0: } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_PORT)) {
aoqi@0: return handlePortExtension(context, parent, e);
aoqi@0: } else {
aoqi@0: return false;
aoqi@0: }
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Callback for wsdl:portType
aoqi@0: *
aoqi@0: * @param context Parser context that will be passed on by the wsdl parser
aoqi@0: * @param parent The Parent element within which the extensibility element is defined
aoqi@0: * @param e The extensibility elemenet
aoqi@0: * @return false if there was some error during the extension handling otherwise returns true. If returned false
aoqi@0: * then the WSDL parser can abort if the wsdl extensibility element had required
attribute set to true
aoqi@0: */
aoqi@0: public boolean handlePortTypeExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
aoqi@0: return false;
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Callback for wsdl:definitions
aoqi@0: *
aoqi@0: * @param context Parser context that will be passed on by the wsdl parser
aoqi@0: * @param parent The Parent element within which the extensibility element is defined
aoqi@0: * @param e The extensibility elemenet
aoqi@0: * @return false if there was some error during the extension handling otherwise returns true. If returned false
aoqi@0: * then the WSDL parser can abort if the wsdl extensibility element had required
attribute set to true
aoqi@0: */
aoqi@0: public boolean handleDefinitionsExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
aoqi@0: return false;
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Callback for wsdl:type
aoqi@0: *
aoqi@0: * @param context Parser context that will be passed on by the wsdl parser
aoqi@0: * @param parent The Parent element within which the extensibility element is defined
aoqi@0: * @param e The extensibility elemenet
aoqi@0: * @return false if there was some error during the extension handling otherwise returns true. If returned false
aoqi@0: * then the WSDL parser can abort if the wsdl extensibility element had required
attribute set to true
aoqi@0: */
aoqi@0: public boolean handleTypesExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
aoqi@0: return false;
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Callback for wsdl:binding
aoqi@0: *
aoqi@0: * @param context Parser context that will be passed on by the wsdl parser
aoqi@0: * @param parent The Parent element within which the extensibility element is defined
aoqi@0: * @param e The extensibility elemenet
aoqi@0: * @return false if there was some error during the extension handling otherwise returns true. If returned false
aoqi@0: * then the WSDL parser can abort if the wsdl extensibility element had required
attribute set to true
aoqi@0: */
aoqi@0: public boolean handleBindingExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
aoqi@0: return false;
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Callback for wsdl:portType/wsdl:operation
.
aoqi@0: *
aoqi@0: * @param context Parser context that will be passed on by the wsdl parser
aoqi@0: * @param parent The Parent element within which the extensibility element is defined
aoqi@0: * @param e The extensibility elemenet
aoqi@0: * @return false if there was some error during the extension handling otherwise returns true. If returned false
aoqi@0: * then the WSDL parser can abort if the wsdl extensibility element had required
attribute set to true
aoqi@0: */
aoqi@0: public boolean handleOperationExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
aoqi@0: return false;
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Callback for wsdl:input
aoqi@0: *
aoqi@0: * @param context Parser context that will be passed on by the wsdl parser
aoqi@0: * @param parent The Parent element within which the extensibility element is defined
aoqi@0: * @param e The extensibility elemenet
aoqi@0: * @return false if there was some error during the extension handling otherwise returns true. If returned false
aoqi@0: * then the WSDL parser can abort if the wsdl extensibility element had required
attribute set to true
aoqi@0: */
aoqi@0: public boolean handleInputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
aoqi@0: return false;
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Callback for wsdl:output
aoqi@0: *
aoqi@0: * @param context Parser context that will be passed on by the wsdl parser
aoqi@0: * @param parent The Parent element within which the extensibility element is defined
aoqi@0: * @param e The extensibility elemenet
aoqi@0: * @return false if there was some error during the extension handling otherwise returns true. If returned false
aoqi@0: * then the WSDL parser can abort if the wsdl extensibility element had required
attribute set to true
aoqi@0: */
aoqi@0: public boolean handleOutputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
aoqi@0: return false;
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Callback for wsdl:fault
aoqi@0: *
aoqi@0: * @param context Parser context that will be passed on by the wsdl parser
aoqi@0: * @param parent The Parent element within which the extensibility element is defined
aoqi@0: * @param e The extensibility elemenet
aoqi@0: * @return false if there was some error during the extension handling otherwise returns true. If returned false
aoqi@0: * then the WSDL parser can abort if the wsdl extensibility element had required
attribute set to true
aoqi@0: */
aoqi@0: public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
aoqi@0: return false;
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Callback for wsdl:service
aoqi@0: *
aoqi@0: * @param context Parser context that will be passed on by the wsdl parser
aoqi@0: * @param parent The Parent element within which the extensibility element is defined
aoqi@0: * @param e The extensibility elemenet
aoqi@0: * @return false if there was some error during the extension handling otherwise returns true. If returned false
aoqi@0: * then the WSDL parser can abort if the wsdl extensibility element had required
attribute set to true
aoqi@0: */
aoqi@0: public boolean handleServiceExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
aoqi@0: return false;
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Callback for wsdl:port
aoqi@0: *
aoqi@0: * @param context Parser context that will be passed on by the wsdl parser
aoqi@0: * @param parent The Parent element within which the extensibility element is defined
aoqi@0: * @param e The extensibility elemenet
aoqi@0: * @return false if there was some error during the extension handling otherwise returns true. If returned false
aoqi@0: * then the WSDL parser can abort if the wsdl extensibility element had required
attribute set to true
aoqi@0: */
aoqi@0: public boolean handlePortExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
aoqi@0: return false;
aoqi@0: }
aoqi@0: }