Parser
- the class used for CSV parsingPrinter
- the class used for CSV printingpublic abstract class CsvFormat<Parser extends CsvParser,Printer extends CsvPrinter> extends Object
CsvParser
and writing through CsvPrinter
.Modifier | Constructor and Description |
---|---|
protected |
CsvFormat(org.apache.commons.csv.CSVFormat format)
Create with specifications of a
CSVFormat . |
Modifier and Type | Method and Description |
---|---|
abstract String |
getEncoding()
Returns the encoding of created CSV data.
|
org.apache.commons.csv.CSVFormat |
getFormat()
Returns the contained
CSVFormat . |
protected abstract Parser |
newParser(org.apache.commons.csv.CSVParser parser)
Creates a new
CsvParser for a CSVParser . |
protected abstract Printer |
newPrinter(org.apache.commons.csv.CSVPrinter printer)
Creates a new
CsvPrinter for a CSVPrinter . |
Parser |
parse(File csvFile)
|
Parser |
parse(InputStream input)
Creates a
CsvParser from an InputStream with CSV data. |
Parser |
parse(Reader input)
|
Parser |
parse(String csvString)
|
protected Printer |
print(Appendable output)
Creates a
CsvPrinter , that writes CSV data into an
Appendable object. |
Printer |
print(File csvFile)
Creates a
CsvPrinter , that writes CSV data into a File . |
Printer |
print(OutputStream output)
Creates a
CsvPrinter , that writes CSV data into an
OutputStream . |
Printer |
print(StringBuffer csvString)
Creates a
CsvPrinter , that writes CSV data into a
StringBuffer . |
Printer |
print(StringBuilder csvString)
Creates a
CsvPrinter , that writes CSV data into a
StringBuilder . |
Printer |
print(Writer output)
Creates a
CsvPrinter , that writes CSV data into a Writer . |
protected CsvFormat(org.apache.commons.csv.CSVFormat format)
CSVFormat
.format
- the CSV format from
commons-csvpublic abstract String getEncoding()
public final org.apache.commons.csv.CSVFormat getFormat()
CSVFormat
.protected abstract Parser newParser(org.apache.commons.csv.CSVParser parser)
CsvParser
for a CSVParser
.parser
- the CSV parser from
commons-csvprotected abstract Printer newPrinter(org.apache.commons.csv.CSVPrinter printer)
CsvPrinter
for a CSVPrinter
.printer
- the CSV printer from
commons-csvpublic final Parser parse(String csvString) throws IOException
csvString
- CSV stringIOException
- if CSV is not readablepublic final Parser parse(File csvFile) throws IOException
csvFile
- CSV fileIOException
- if CSV is not readablepublic final Parser parse(InputStream input) throws IOException
CsvParser
from an InputStream
with CSV data.input
- CSV inputIOException
- if CSV is not readablepublic Parser parse(Reader input) throws IOException
input
- CSV inputIOException
- if CSV is not readablepublic final Printer print(StringBuffer csvString) throws IOException
CsvPrinter
, that writes CSV data into a
StringBuffer
.csvString
- where CSV is written toIOException
- if CSV is not writablepublic final Printer print(StringBuilder csvString) throws IOException
CsvPrinter
, that writes CSV data into a
StringBuilder
.csvString
- where CSV is written toIOException
- if CSV is not writablepublic final Printer print(File csvFile) throws IOException
CsvPrinter
, that writes CSV data into a File
.csvFile
- where CSV is written toIOException
- if CSV is not writablepublic final Printer print(OutputStream output) throws IOException
CsvPrinter
, that writes CSV data into an
OutputStream
.output
- where CSV is written toIOException
- if CSV is not writablepublic final Printer print(Writer output) throws IOException
CsvPrinter
, that writes CSV data into a Writer
.output
- where CSV is written toIOException
- if CSV is not writableprotected Printer print(Appendable output) throws IOException
CsvPrinter
, that writes CSV data into an
Appendable
object.
Use this function to, to override the print methods through inheritance.
output
- where CSV is written toIOException
- if CSV is not writableCopyright © 2015 OpenEstate. All rights reserved.