Java Utililty Methods XML Attribute Get

List of utility methods to do XML Attribute Get

Description

The list of methods to do XML Attribute Get are organized into topic(s).

Method

StringgetBeanclassAttribute(Node node)
get Beanclass Attribute
if (node != null) {
    NamedNodeMap attributes = node.getAttributes();
    Node beanclassAttribute = attributes.getNamedItem("beanclass");
    if (beanclassAttribute != null) {
        return beanclassAttribute.getNodeValue();
return null;
...
booleangetBool(Element el, String attrName, boolean defaultValue)
get Bool
if (el.hasAttribute(attrName))
    return Boolean.parseBoolean(el.getAttribute(attrName));
return defaultValue;
BooleangetBoolAttribute(NamedNodeMap namedNodeMap, String name)
get Bool Attribute
String value = getAttribute(namedNodeMap, name);
if (value == null) {
    return null;
} else {
    return Boolean.valueOf(value);
booleangetBoolAttribute(Node node, String attr)
get Bool Attribute
return getBoolAttribute(node, attr, false);
booleangetBoolAttribute(Node node, String name)
get Bool Attribute
return Boolean.parseBoolean(getAttribute(node, name));
booleangetBoolAttribute(Node node, String name, boolean defVal)
get Bool Attribute
String att = getAttribute(node, name);
if (att == null)
    return defVal;
return Boolean.parseBoolean(att);
booleangetBoolean(Element element, String attribute, boolean defaultValue)
get Boolean
String theValue = element.getAttribute(attribute);
if (StringUtils.hasText(theValue)) {
    return Boolean.valueOf(theValue);
return defaultValue;
booleangetBooleanAttr(Element element, String name)
get Boolean Attr
String attr = element.getAttribute(name);
boolean ret = attr.equalsIgnoreCase("true");
return ret;
booleangetBooleanAttrib(Element element, String attribName, String namespaceURI)
Get a boolean attribute from the supplied element.
String attribVal = element.getAttributeNS(namespaceURI, attribName);
return (attribVal != null ? attribVal.equalsIgnoreCase("true") : false);
booleangetBooleanAttribute(Element e, String name)
Helper to get an attribute if it exists or return null.
String val = getAttribute(e, name);
return Boolean.parseBoolean(val);