Java XML Node Value Check isEmpty(Node node)

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

Description

Returns true if the specified node is null or has no children.

License

Apache License

Parameter

Parameter Description
node The node to test.

Return

True if the specified node is null or has no children.

Declaration

public static boolean isEmpty(Node node) 

Method Source Code

//package com.java2s;
/*//from  www.  j  a va2  s.  co  m
 * Copyright 2011-2013 Amazon Technologies, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *    http://aws.amazon.com/apache2.0
 *
 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
 * OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and
 * limitations under the License.
 */

import org.w3c.dom.Node;

public class Main {
    /**
     * Returns true if the specified node is null or has no children.
     *
     * @param node
     *            The node to test.
     *
     * @return True if the specified node is null or has no children.
     */
    public static boolean isEmpty(Node node) {
        return (node == null);
    }
}

Related

  1. isContainerElement(Node node)
  2. isCreateInstanceSet(Node node)
  3. isElementNodeExist(Node root, String nodeString)
  4. isElementNodeOfType(final Node n, final String type)
  5. isElementType(Node _node)
  6. isEmptyTag(Node p_node)
  7. isEqual(Node a, Node b)
  8. isExpanded(Node node)
  9. isFiltered(Node node)