com.processpuzzle.fitnesse.print.html.XmlUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fit-print-plugin Show documentation
Show all versions of fit-print-plugin Show documentation
FitNesse Plugin to print wiki content into PDF.
The newest version!
package com.processpuzzle.fitnesse.print.html;
import java.util.AbstractList;
import java.util.Collections;
import java.util.List;
import java.util.RandomAccess;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
public final class XmlUtil {
private XmlUtil() {}
public static List asList( NodeList n ) {
return n.getLength() == 0 ? Collections. emptyList() : new NodeListWrapper( n );
}
static final class NodeListWrapper extends AbstractList implements RandomAccess {
private final NodeList list;
NodeListWrapper( NodeList l ) {
list = l;
}
public Node get( int index ) {
return list.item( index );
}
public int size() {
return list.getLength();
}
}
}