Java XML Node Value getNodeValueAsLong(Node node)

Here you can find the source of getNodeValueAsLong(Node node)

Description

Gets the node value as long.

License

Open Source License

Parameter

Parameter Description
node Description of the Parameter

Return

The nodeValueAsLong value

Declaration

public final static long getNodeValueAsLong(Node node) throws DOMException 

Method Source Code

//package com.java2s;
/**/* www  . j a v  a  2  s .  c om*/
 * Copyright (c) 1999-2007, Fiorano Software Technologies Pvt. Ltd. and affiliates.
 * Copyright (c) 2008-2015, Fiorano Software Pte. Ltd. and affiliates.
 *
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Fiorano Software ("Confidential Information").  You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * enclosed with this product or entered into with Fiorano.
 */

import org.w3c.dom.*;

public class Main {
    /**
     *  Gets the node value as long.
     *
     *@param  node              Description of the Parameter
     *@return                   The nodeValueAsLong value
     *@exception  DOMException  Description of the Exception
     */
    public final static long getNodeValueAsLong(Node node) throws DOMException {
        if (node != null) {
            node = node.getFirstChild();
            if (node != null)
                return Long.parseLong(node.getNodeValue());
        }
        return -1;
    }
}

Related

  1. getNodeValue(Node node, String nodeKey)
  2. getNodeValue(Node nodeXML)
  3. getNodeValue(org.w3c.dom.Node node)
  4. getNodeValue(org.w3c.dom.Node node)
  5. getNodeValueAsDate(Node node)
  6. getNodeValueAsTime(Node node)
  7. getValue(Node node)
  8. getValue(Node node)
  9. getValue(Node node)