com.sun.tools.ws.wsdl.parser.W3CAddressingExtensionHandler Maven / Gradle / Ivy
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
package com.sun.tools.ws.wsdl.parser;
import com.sun.tools.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.ws.api.wsdl.TWSDLParserContext;
import com.sun.tools.ws.resources.WsdlMessages;
import com.sun.tools.ws.util.xml.XmlUtil;
import com.sun.tools.ws.wscompile.ErrorReceiver;
import com.sun.tools.ws.wsdl.document.Fault;
import com.sun.tools.ws.wsdl.document.Input;
import com.sun.tools.ws.wsdl.document.Output;
import com.sun.xml.ws.api.addressing.AddressingVersion;
import org.w3c.dom.Element;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
import java.util.Map;
/**
* @author Arun Gupta
*/
public class W3CAddressingExtensionHandler extends AbstractExtensionHandler {
public W3CAddressingExtensionHandler(Map extensionHandlerMap) {
this(extensionHandlerMap, null);
}
public W3CAddressingExtensionHandler(Map extensionHandlerMap, ErrorReceiver errReceiver) {
super(extensionHandlerMap);
}
@Override
public String getNamespaceURI() {
return AddressingVersion.W3C.wsdlNsUri;
}
protected QName getWSDLExtensionQName() {
return AddressingVersion.W3C.wsdlExtensionTag;
}
@Override
public boolean handleBindingExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
if (XmlUtil.matchesTagNS(e, getWSDLExtensionQName())) {
/*
context.push();
context.registerNamespaces(e);
// TODO: read UsingAddressing extensibility element and store
// TODO: it as extension in "parent". It may be used to generate
// TODO: @Action/@FaultAction later.
context.pop();
*/
return true;
}
return false; // keep compiler happy
}
@Override
public boolean handlePortExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
return handleBindingExtension(context, parent, e);
}
}