Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.AbstractList;

import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class Main {
    public static void getAllChildrenText(Element paramElement, String paramString,
            AbstractList paramAbstractList) {
        NodeList localNodeList = paramElement.getChildNodes();
        for (int i = 0; i < localNodeList.getLength(); i++) {
            Node localNode = localNodeList.item(i);
            if ((localNode.getNodeType() == 1) && (((Element) localNode).getTagName().equals(paramString))) {
                String str = getNodeText(localNode);
                if (str != null)
                    paramAbstractList.add(str);
            }
        }
    }

    public static String getNodeText(Node paramNode) {
        if (paramNode == null)
            return null;
        String str = paramNode.getNodeValue();
        if ("null".equals(str))
            return null;
        return str;
    }
}