com.sun.tools.ws.util.xml.XmlUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webservices-osgi Show documentation
Show all versions of webservices-osgi Show documentation
Metro Web Services Runtime OSGi Bundle
The newest version!
/*
* Copyright (c) 1997, 2022 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.util.xml;
import com.sun.tools.ws.util.WSDLParseException;
import org.w3c.dom.Element;
/**
* @author WS Development Team
*/
public final class XmlUtil extends com.sun.xml.ws.util.xml.XmlUtil {
private XmlUtil() {}
public static boolean matchesTagNS(Element e, String tag, String nsURI) {
try {
return e.getLocalName().equals(tag)
&& e.getNamespaceURI().equals(nsURI);
} catch (NullPointerException npe) {
// localname not null since parsing would fail before here
throw new WSDLParseException(
"null.namespace.found",
e.getLocalName());
}
}
public static boolean matchesTagNS(
Element e,
javax.xml.namespace.QName name) {
try {
return e.getLocalName().equals(name.getLocalPart())
&& e.getNamespaceURI().equals(name.getNamespaceURI());
} catch (NullPointerException npe) {
// localname not null since parsing would fail before here
throw new WSDLParseException(
"null.namespace.found",
e.getLocalName());
}
}
}