Here you can find the source of getAttributeAsBoolean(Element element, String attrName, boolean defValue)
public static final boolean getAttributeAsBoolean(Element element, String attrName, boolean defValue)
//package com.java2s; import org.w3c.dom.Element; public class Main { public static final boolean getAttributeAsBoolean(Element element, String attrName, boolean defValue) { String value = element.getAttribute(attrName); try {/*from www . j av a 2s . com*/ if ((value != null) && (value.length() > 0)) { return Boolean.valueOf(value).booleanValue(); } } catch (Exception ex) { } return defValue; } }