Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import org.w3c.dom.Element;

public class Main {
    public static boolean getOptionalBoolean(Element element, String attribute, boolean defaultValue) {
        String s = element.getAttribute(attribute);
        if (s == null || "".equals(s)) {
            return defaultValue;
        } else {
            return Boolean.valueOf(s).booleanValue();
        }
    }
}