Java XML NodeList iterableNodes(final NodeList nodeList)

Here you can find the source of iterableNodes(final NodeList nodeList)

Description

iterable Nodes

License

Open Source License

Declaration

static Iterable<Node> iterableNodes(final NodeList nodeList) 

Method Source Code


//package com.java2s;
// Use of this source code is governed by a BSD-style license that can be

import java.util.AbstractList;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class Main {
    static Iterable<Node> iterableNodes(final NodeList nodeList) {
        return new AbstractList<Node>() {
            @Override//from  w ww.ja  v  a 2 s .co  m
            public Node get(int index) {
                return nodeList.item(index);
            }

            @Override
            public int size() {
                return nodeList.getLength();
            }
        };
    }
}

Related

  1. isNotEmpty(NodeList nodeList)
  2. isNullOrEmpty(NodeList nodeList)
  3. iterable(final NodeList list)
  4. iterable(NodeList nodeList)
  5. iterableNodes(final NodeList nodeList)
  6. listOf(final NodeList nodeList)
  7. listOf(final NodeList nodeList)
  8. mapNodeList(NodeList nodeList)
  9. mergeTextContent(final NodeList nodes)