Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import org.w3c.dom.Element;

public class Main {
    public static Boolean getAttribAsBoolean(Element e, String name) {
        return getAttribAsBoolean(e, name, false);
    }

    public static Boolean getAttribAsBoolean(Element e, String name, Boolean dft) {
        if (getAttribute(e, name) == null)
            return dft;
        else
            return Boolean.parseBoolean(getAttribute(e, name));
    }

    public static String getAttribute(Element e, String name) {
        if (e.getAttribute(name) == null)
            return "";
        return e.getAttribute(name);
    }
}