com.sun.tools.xjc.reader.dtd.bindinfo.DOMUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jaxb-xjc Show documentation
Show all versions of jaxb-xjc Show documentation
JAXB Binding Compiler. Contains source code needed for binding customization files into java sources.
In other words: the *tool* to generate java classes for the given xml representation.
/*
* Copyright (c) 1997, 2021 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.xjc.reader.dtd.bindinfo;
import java.util.ArrayList;
import java.util.List;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
* @author Kohsuke Kawaguchi
*/
public final class DOMUtil {
final static String getAttribute(Element e,String attName) {
if(e.getAttributeNode(attName)==null) return null;
return e.getAttribute(attName);
}
public static String getAttribute(Element e, String nsUri, String local) {
if(e.getAttributeNodeNS(nsUri,local)==null) return null;
return e.getAttributeNS(nsUri,local);
}
public static Element getElement(Element e, String nsUri, String localName) {
NodeList l = e.getChildNodes();
for(int i=0;i getChildElements(Element e) {
List r = new ArrayList();
NodeList l = e.getChildNodes();
for(int i=0;i getChildElements(Element e,String localName) {
List r = new ArrayList();
NodeList l = e.getChildNodes();
for(int i=0;i