Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* 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.TWSDLExtensionHandler;
import com.sun.tools.ws.api.wsdl.TWSDLParserContext;
import com.sun.tools.ws.util.xml.XmlUtil;
import com.sun.xml.ws.policy.sourcemodel.wspolicy.NamespaceVersion;
import com.sun.xml.ws.policy.sourcemodel.wspolicy.XmlToken;
import org.w3c.dom.Element;
/**
* Policies are evaluated at runtime. This class makes sure that wscompile/wsimport
* ignores all policy elements at tooltime.
*
* @author Jakub Podlesak (jakub.podlesak at sun.com)
* @author Fabian Ritzmann
*/
public class Policy15ExtensionHandler extends TWSDLExtensionHandler {
@Override
public String getNamespaceURI() {
return NamespaceVersion.v1_5.toString();
}
@Override
public boolean handlePortTypeExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
return handleExtension(context, parent, e);
}
@Override
public boolean handleDefinitionsExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
return handleExtension(context, parent, e);
}
@Override
public boolean handleBindingExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
return handleExtension(context, parent, e);
}
@Override
public boolean handleOperationExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
return handleExtension(context, parent, e);
}
@Override
public boolean handleInputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
return handleExtension(context, parent, e);
}
@Override
public boolean handleOutputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
return handleExtension(context, parent, e);
}
@Override
public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
return handleExtension(context, parent, e);
}
@Override
public boolean handleServiceExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
return handleExtension(context, parent, e);
}
@Override
public boolean handlePortExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
return handleExtension(context, parent, e);
}
/**
* Only skip the element if it is a , or
* element.
*/
private boolean handleExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
return XmlUtil.matchesTagNS(e, NamespaceVersion.v1_5.asQName(XmlToken.Policy))
|| XmlUtil.matchesTagNS(e,NamespaceVersion.v1_5.asQName(XmlToken.PolicyReference))
|| XmlUtil.matchesTagNS(e, NamespaceVersion.v1_5.asQName(XmlToken.UsingPolicy));
}
}