net.sf.jmatchparser.util.csv
Class XMLCSVWriter

java.lang.Object
  extended by net.sf.jmatchparser.util.csv.AbstractCSVWriter
      extended by net.sf.jmatchparser.util.csv.XMLCSVWriter

public class XMLCSVWriter
extends AbstractCSVWriter

Class to create an XML file as if it was a CSV (Comma Separated Value) file.


Constructor Summary
XMLCSVWriter(Node root, String rowTag, String... cellTags)
          Create a new XMLCSVWriter that writes to the given DOM document.
XMLCSVWriter(OutputStream out, String rootTag, String rowTag, String... cellTags)
          Create a new XMLCSVWriter that writes to the given DOM document.
 
Method Summary
 void close()
          Close this CSV writer.
 void flush()
          Flush this CSV writer.
 void write(String... record)
          Write a record (line) into this CSV file.
 
Methods inherited from class net.sf.jmatchparser.util.csv.AbstractCSVWriter
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLCSVWriter

public XMLCSVWriter(Node root,
                    String rowTag,
                    String... cellTags)
Create a new XMLCSVWriter that writes to the given DOM document. Rows will become child elements given root element that have the row tag as name, and cells will become children of the row, with the cell tags (assigned round robin) as name.

Parameters:
root - the root node
rowTag - the name of row elements
cellTags - the names of cell elements

XMLCSVWriter

public XMLCSVWriter(OutputStream out,
                    String rootTag,
                    String rowTag,
                    String... cellTags)
             throws ParserConfigurationException
Create a new XMLCSVWriter that writes to the given DOM document. Rows will become child elements of the document element that have the row tag as name, and cells will become children of the row, with the cell tags (assigned round robin) as name.

Parameters:
out - Output stream to write to
rootTag - the name of the root element
rowTag - the name of row elements
cellTags - the names of cell elements
Throws:
ParserConfigurationException
Method Detail

flush

public void flush()
           throws IOException
Description copied from class: AbstractCSVWriter
Flush this CSV writer.

Specified by:
flush in class AbstractCSVWriter
Throws:
IOException

close

public void close()
           throws IOException
Description copied from class: AbstractCSVWriter
Close this CSV writer.

Specified by:
close in class AbstractCSVWriter
Throws:
IOException

write

public void write(String... record)
           throws IOException
Description copied from class: AbstractCSVWriter
Write a record (line) into this CSV file.

Specified by:
write in class AbstractCSVWriter
Throws:
IOException


Copyright © 2011. All Rights Reserved.