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 {
    /**
     * @param eElement element containing boolean attribute
     * @param atribute name of attribute in element
     * @return value of boolean or null if attribute not exists
     */
    public static Boolean getBooleanElementAtribute(Element eElement, String atribute) {
        String atr = eElement.getAttribute(atribute);
        if (atr != null && !atr.isEmpty()) {
            return Boolean.valueOf(atr);
        }
        return null;
    }
}