Java XML Attribute Read getLongAttribute(NamedNodeMap namedNodeMap, String name)

Here you can find the source of getLongAttribute(NamedNodeMap namedNodeMap, String name)

Description

get Long Attribute

License

Apache License

Declaration

public static Long getLongAttribute(NamedNodeMap namedNodeMap, String name) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

public class Main {
    public static Long getLongAttribute(NamedNodeMap namedNodeMap, String name) {
        String value = getAttribute(namedNodeMap, name);
        if (value == null) {
            return null;
        } else {//from   w  w  w  .  jav  a  2s .  com
            return Long.valueOf(value);
        }
    }

    public static String getAttribute(NamedNodeMap namedNodeMap, String name) {
        Node node = namedNodeMap.getNamedItem(name);
        if (node == null) {
            return null;
        }
        return node.getNodeValue();
    }
}

Related

  1. getLong(Node xmlNode, String attributeLabel)
  2. getLong(String attrName, Map runtimeAttributes, Node docElement)
  3. getLongAttribute(String name, Element el)
  4. getNameAttribute(final Node aNode)
  5. getNamedAttribute(final Node aNode, final String attributeName)
  6. getNewAttribute(Element element, String name)