Java XML Attribute Get getBool(Element el, String attrName, boolean defaultValue)

Here you can find the source of getBool(Element el, String attrName, boolean defaultValue)

Description

get Bool

License

Open Source License

Declaration

public static boolean getBool(Element el, String attrName, boolean defaultValue) 

Method Source Code


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

import org.w3c.dom.Element;

public class Main {
    public static boolean getBool(Element el, String attrName, boolean defaultValue) {
        if (el.hasAttribute(attrName))
            return Boolean.parseBoolean(el.getAttribute(attrName));
        return defaultValue;
    }/*from ww  w  .  j  a  v a 2 s. c o m*/
}

Related

  1. getAttrValue(NamedNodeMap attrs, String attrName)
  2. getAttrvalue(Node item, String name, boolean ignoreNs)
  3. getAttrValue(Node n, String name)
  4. getAttrValuesByName(Element ele, String attributeName)
  5. getBeanclassAttribute(Node node)
  6. getBoolAttribute(NamedNodeMap namedNodeMap, String name)
  7. getBoolAttribute(Node node, String attr)
  8. getBoolAttribute(Node node, String name)
  9. getBoolAttribute(Node node, String name, boolean defVal)