public class CSVWriter extends Object implements Closeable
Constructor and Description |
---|
CSVWriter(CSVSettings settings) |
CSVWriter(Element config) |
CSVWriter(OutputStream out) |
CSVWriter(OutputStream out,
Charset charset) |
CSVWriter(OutputStream out,
CSVSettings settings) |
CSVWriter(Writer input) |
CSVWriter(Writer input,
CSVSettings settings) |
Modifier and Type | Method and Description |
---|---|
void |
close()
closes the underlying writer
|
void |
endRecord()
the next time you use
write(Object) a new record will be started |
void |
flush()
the underlying writer will be flushed
|
CSVSettings |
getSettings() |
void |
write(Object obj)
writes the given object
|
void |
writeAll(List<? extends List<?>> lines)
writes all records
|
void |
writeAll(TableModel tm)
writes the whole tm
TableModel.getColumnName(int) for header |
void |
writeComment(String comment) |
void |
writeHeader(List<String> header)
write the header-record
|
void |
writeRecord(List<?> line)
writes a whole record
|
public CSVWriter(CSVSettings settings)
settings
- the settings to usepublic CSVWriter(Element config) throws InstantiationException, IllegalAccessException, ClassNotFoundException
public CSVWriter(OutputStream out)
out
- the stream the data will be written topublic CSVWriter(OutputStream out, Charset charset)
out
- the stream the data will be written tocharset
- the charset to be usedpublic CSVWriter(OutputStream out, CSVSettings settings)
out
- the stream the data will be written tosettings
- the settings to usepublic CSVWriter(Writer input)
input
- the reader to read frompublic CSVWriter(Writer input, CSVSettings settings)
input
- the reader to read fromsettings
- the settings to usepublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void endRecord() throws IOException
write(Object)
a new record will be startedIOException
public void flush() throws IOException
IOException
public CSVSettings getSettings()
public void write(Object obj) throws IOException
obj
- IOException
public void writeAll(List<? extends List<?>> lines) throws IOException
lines
- IOException
public void writeAll(TableModel tm) throws IOException
TableModel.getColumnName(int)
for headertm
- IOException
public void writeHeader(List<String> header) throws IOException
header
- IOException
public void writeRecord(List<?> line) throws IOException
line
- IOException
public void writeComment(String comment) throws IOException
IOException
@enterprise 10.0.38375 Copyright © 2001-2024 Groiss Informatics GmbH. All Rights Reserved.