net.sf.jmatchparser.util.csv
Class XPathCSVReader

java.lang.Object
  extended by net.sf.jmatchparser.util.csv.AbstractCSVReader
      extended by net.sf.jmatchparser.util.csv.XPathCSVReader

public class XPathCSVReader
extends AbstractCSVReader

Class to read data from an XML file as if it was a CSV (Comma Separated Value) file, using XPathExpressions for the columns.


Constructor Summary
XPathCSVReader(Document doc, String rowExpression, String... columnExpressions)
          Create a new XPathCSVReader that reads from the given DOM document.
XPathCSVReader(Document doc, XPathExpression rowExpression, XPathExpression... columnExpressions)
          Create a new XPathCSVReader that reads from the given DOM document.
 
Method Summary
 void close()
          Close this reader.
 String[] read()
          Read a row from this XML file.
 
Methods inherited from class net.sf.jmatchparser.util.csv.AbstractCSVReader
read, read, writeTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathCSVReader

public XPathCSVReader(Document doc,
                      String rowExpression,
                      String... columnExpressions)
               throws XPathExpressionException
Create a new XPathCSVReader that reads from the given DOM document. The rowExpression is expected to return a NodeList of rows, each columnExpression is evaluated on each of the rows to find the column values.

Throws:
XPathExpressionException

XPathCSVReader

public XPathCSVReader(Document doc,
                      XPathExpression rowExpression,
                      XPathExpression... columnExpressions)
               throws XPathExpressionException
Create a new XPathCSVReader that reads from the given DOM document. The rowExpression is expected to return a NodeList of rows, each columnExpression is evaluated on each of the rows to find the column values.

Throws:
XPathExpressionException
Method Detail

close

public void close()
           throws IOException
Close this reader. This is a no-op.

Specified by:
close in class AbstractCSVReader
Throws:
IOException

read

public String[] read()
              throws IOException
Read a row from this XML file.

Specified by:
read in class AbstractCSVReader
Throws:
IOException


Copyright © 2011. All Rights Reserved.