Java XML Attribute Get getAttributeAsInteger(Element element, String attrName, Integer defValue)

Here you can find the source of getAttributeAsInteger(Element element, String attrName, Integer defValue)

Description

get Attribute As Integer

License

Open Source License

Declaration

public static final Integer getAttributeAsInteger(Element element, String attrName, Integer defValue) 

Method Source Code

//package com.java2s;

import org.w3c.dom.Element;

public class Main {
    public static final Integer getAttributeAsInteger(Element element, String attrName, Integer defValue) {
        try {/*from w w w  .j  a  va2s .com*/
            return Integer.valueOf(element.getAttribute(attrName));
        } catch (Exception ex) {
        }

        return defValue;
    }
}

Related

  1. getAttributeAsBoolean(Element elem, String attribName)
  2. getAttributeAsBoolean(Element element, String attrName, boolean defValue)
  3. getAttributeAsBoolean(Element element, String attrName, boolean defValue)
  4. getAttributeAsBoolean(Element element, String name)
  5. getAttributeAsBoolean(NamedNodeMap map, String name)
  6. getAttributeAsLong(Element element, String attrName, Long defValue)
  7. getAttributeAsString(NamedNodeMap attributes, String name)
  8. getAttributeAsString(XMLStreamReader reader, String name)
  9. getAttributeAsURIString(XMLStreamReader reader, String name)