Android XML Element Attribute Get getBooleanAttribute(Element el, String name)

Here you can find the source of getBooleanAttribute(Element el, String name)

Description

get Boolean Attribute

Declaration

public static boolean getBooleanAttribute(Element el, String name) 

Method Source Code

//package com.java2s;

import org.w3c.dom.Element;

public class Main {
    public static boolean getBooleanAttribute(Element el, String name) {
        String s = el.getAttribute(name);
        if (s == null || "0".equals(s)) {
            return false;
        }//from  w w  w . j  a v  a  2  s . c o m
        if ("1".equals(s)) {
            return true;
        }
        return new Boolean(s).booleanValue();
    }
}

Related

  1. getAttributeValue(Element elem, String name)
  2. getIntAttribute(Element el, String name)
  3. processAnyAttributes(Element element, Map anyAttributes)
  4. getNodeAttrValue(Element parent, String nodeName, String attrName)