net.sf.jmatchparser.util.csv
Class CSVFactory

java.lang.Object
  extended by net.sf.jmatchparser.util.csv.CSVFactory

public class CSVFactory
extends Object

Utility class to create CSV readers and writers based on an input file and a format string that describes the format of the CSV file.


Method Summary
static AbstractCSVReader createReader(InputStream in, String formatString)
          Create an AbstractCSVReader from a format string.
static AbstractCSVWriter createWriter(OutputStream out, String formatString)
          Create an AbstractCSVWriter from a format string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createReader

public static AbstractCSVReader createReader(InputStream in,
                                             String formatString)
                                      throws IOException
Create an AbstractCSVReader from a format string.

CSVReader

separator=auto|comma|semicolon|tab|char[, flags=comments|quotedlines|multiline[+...]][, charset=charset]

FixedWidthCSVReader

fixed=columnSpec1[,...][, prefix=prefix][, separator=separator][, suffix=suffix][, flags=comments][, charset=charset]

PropertiesCSVReader

properties=firstIndex,columnFormat1[,...]

XMLCSVReader

xml=rowTag,cellTag1[,...]

XPathCSVReader

xpath=rowExpression,columnExpression1[,...]

Parameters:
in - Input stream to read data from
formatString - Format string
Returns:
The CSV reader
Throws:
IOException

createWriter

public static AbstractCSVWriter createWriter(OutputStream out,
                                             String formatString)
                                      throws IOException
Create an AbstractCSVWriter from a format string.

CSVWriter

separator=comma|semicolon|tab|char[, charset=charset]

FixedWidthCSVWriter

fixed=columnSpec1[,...][, prefix=prefix][, separator=separator][, suffix=suffix][, flags=truncate][, charset=charset]

PropertiesCSVWriter

properties=firstIndex,columnFormat1[,...]

XMLCSVWriter

xml=rowTag,cellTag1[,...]

Parameters:
out - Output stream to write to
formatString - Format string
Returns:
The CSV reader
Throws:
IOException


Copyright © 2011. All Rights Reserved.