public class Csv
extends java.lang.Object
Constructor and Description |
---|
Csv() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close all streams.
|
char |
getEscapeCharacter()
Get the current escape character.
|
char |
getFieldDelimiter()
Get the current field delimiter.
|
char |
getFieldSeparatorRead()
Get the current field separator for reading.
|
java.lang.String |
getFieldSeparatorWrite()
Get the current field separator for writing.
|
java.lang.String |
getNullString()
Get the current null string.
|
java.lang.String |
getRowSeparatorWrite()
Get the current row separator for writing.
|
java.util.Iterator<java.lang.String[]> |
read(java.io.InputStream in,
java.lang.String charset)
Reads from the CSV file and returns an iterator.
|
java.util.Iterator<java.lang.String[]> |
read(java.io.Reader reader)
Reads from the CSV file and returns an iterator.
|
void |
setEscapeCharacter(char escapeCharacter)
Set the escape character (used to escape the field delimiter).
|
void |
setFieldDelimiter(char fieldDelimiter)
Set the field delimiter.
|
void |
setFieldSeparatorRead(char fieldSeparatorRead)
Override the field separator for reading.
|
void |
setFieldSeparatorWrite(java.lang.String fieldSeparatorWrite)
Override the field separator for writing.
|
void |
setLineSeparator(java.lang.String lineSeparator)
Set the line separator.
|
void |
setNullString(java.lang.String nullString)
Set the value that represents NULL.
|
void |
setRowSeparatorWrite(java.lang.String rowSeparatorWrite)
Override the end-of-row marker for writing.
|
void |
writeInit(java.io.OutputStream out,
java.lang.String charset)
Initialize writing.
|
void |
writeInit(java.io.Writer writer)
Initialize writing.
|
void |
writeRow(java.lang.String... values)
Write a row.
|
public java.util.Iterator<java.lang.String[]> read(java.io.InputStream in, java.lang.String charset) throws java.io.IOException
in
- the input streamcharset
- the charset or null to use the system default charset (see
system property file.encoding)java.io.IOException
public java.util.Iterator<java.lang.String[]> read(java.io.Reader reader) throws java.io.IOException
reader
- the readerjava.io.IOException
public void writeInit(java.io.OutputStream out, java.lang.String charset) throws java.io.IOException
out
- the output streamcharset
- the character set or nulljava.io.IOException
public void writeInit(java.io.Writer writer) throws java.io.IOException
writer
- the writerjava.io.IOException
public void writeRow(java.lang.String... values) throws java.io.IOException
values
- the valuesjava.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public void setFieldSeparatorWrite(java.lang.String fieldSeparatorWrite)
fieldSeparatorWrite
- the field separatorpublic java.lang.String getFieldSeparatorWrite()
public void setFieldSeparatorRead(char fieldSeparatorRead)
fieldSeparatorRead
- the field separatorpublic char getFieldSeparatorRead()
public java.lang.String getRowSeparatorWrite()
public void setRowSeparatorWrite(java.lang.String rowSeparatorWrite)
rowSeparatorWrite
- the row separatorpublic void setFieldDelimiter(char fieldDelimiter)
fieldDelimiter
- the field delimiterpublic char getFieldDelimiter()
public void setEscapeCharacter(char escapeCharacter)
escapeCharacter
- the escape characterpublic char getEscapeCharacter()
public void setLineSeparator(java.lang.String lineSeparator)
lineSeparator
- the line separatorpublic void setNullString(java.lang.String nullString)
nullString
- the nullpublic java.lang.String getNullString()
Copyright © 2010 - 2020 Adobe. All Rights Reserved