Java XML Attribute Set attributeBooleanGet(Element e, String name, boolean defaultValue)

Here you can find the source of attributeBooleanGet(Element e, String name, boolean defaultValue)

Description

attribute Boolean Get

License

Open Source License

Declaration

public static boolean attributeBooleanGet(Element e, String name, boolean defaultValue) 

Method Source Code

//package com.java2s;
/* Copyright 2004 - 2007 Kasper Nielsen <kasper@codehaus.org> Licensed under
 * the Apache 2.0 License, see http://coconut.codehaus.org/license.
 *///  w ww  .j  a va 2s. c o m

import org.w3c.dom.Element;

public class Main {
    public static boolean attributeBooleanGet(Element e, String name, boolean defaultValue) {
        if (!e.hasAttribute(name)) {
            return defaultValue;
        } else {
            return Boolean.parseBoolean(e.getAttribute(name));
        }
    }
}

Related

  1. attr(Element element, String name)
  2. attr(Element element, String name)
  3. attrbiuteToMap( NamedNodeMap attributes)
  4. attribute(Element element, String attrName)
  5. attribute(Node node, String... attributes)
  6. attributeBooleanSet(Element base, String name, boolean value, boolean defaultValue)
  7. attributeBoolValue(Element e, String attr)
  8. attributeFloat(Node node, String attributeName)
  9. attributeIntValue(Element e, String attr)