public class CSVReader
extends java.lang.Object
implements java.io.Closeable
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_SKIP_LINES |
| 构造器和说明 |
|---|
CSVReader(java.io.InputStream is) |
CSVReader(java.io.Reader reader)
Constructs CSVReader using a comma for the separator.
|
CSVReader(java.io.Reader reader,
char separator)
Constructs CSVReader with supplied separator.
|
CSVReader(java.io.Reader reader,
char separator,
char quotechar)
Constructs CSVReader with supplied separator and quote char.
|
CSVReader(java.io.Reader reader,
char separator,
char quotechar,
boolean strictQuotes)
Constructs CSVReader with supplied separator, quote char and quote handling behavior.
|
CSVReader(java.io.Reader reader,
char separator,
char quotechar,
char escape)
Constructs CSVReader with supplied separator and quote char.
|
CSVReader(java.io.Reader reader,
char separator,
char quotechar,
char escape,
int line)
Constructs CSVReader with supplied separator and quote char.
|
CSVReader(java.io.Reader reader,
char separator,
char quotechar,
char escape,
int line,
boolean strictQuotes)
Constructs CSVReader with supplied separator and quote char.
|
CSVReader(java.io.Reader reader,
char separator,
char quotechar,
char escape,
int line,
boolean strictQuotes,
boolean ignoreLeadingWhiteSpace)
Constructs CSVReader with supplied separator and quote char.
|
CSVReader(java.io.Reader reader,
char separator,
char quotechar,
int line)
Constructs CSVReader with supplied separator and quote char.
|
CSVReader(java.lang.String url) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Closes the underlying reader.
|
boolean |
hasNext() |
java.util.List<java.lang.String[]> |
readAll()
Reads the entire file into a List with each element being a String[] of tokens
|
java.lang.String[] |
readNext()
Reads the next line from the buffer and converts to a string array.
|
public static final int DEFAULT_SKIP_LINES
public CSVReader(java.io.Reader reader)
reader - the reader to an underlying CSV source.public CSVReader(java.io.InputStream is)
public CSVReader(java.lang.String url)
public CSVReader(java.io.Reader reader,
char separator)
reader - the reader to an underlying CSV source.separator - the delimiter to use for separating entries.public CSVReader(java.io.Reader reader,
char separator,
char quotechar)
reader - the reader to an underlying CSV source.separator - the delimiter to use for separating entriesquotechar - the character to use for quoted elementspublic CSVReader(java.io.Reader reader,
char separator,
char quotechar,
boolean strictQuotes)
reader - the reader to an underlying CSV source.separator - the delimiter to use for separating entriesquotechar - the character to use for quoted elementsstrictQuotes - sets if characters outside the quotes are ignoredpublic CSVReader(java.io.Reader reader,
char separator,
char quotechar,
char escape)
reader - the reader to an underlying CSV source.separator - the delimiter to use for separating entriesquotechar - the character to use for quoted elementsescape - the character to use for escaping a separator or quotepublic CSVReader(java.io.Reader reader,
char separator,
char quotechar,
int line)
reader - the reader to an underlying CSV source.separator - the delimiter to use for separating entriesquotechar - the character to use for quoted elementsline - the line number to skip for start readingpublic CSVReader(java.io.Reader reader,
char separator,
char quotechar,
char escape,
int line)
reader - the reader to an underlying CSV source.separator - the delimiter to use for separating entriesquotechar - the character to use for quoted elementsescape - the character to use for escaping a separator or quoteline - the line number to skip for start readingpublic CSVReader(java.io.Reader reader,
char separator,
char quotechar,
char escape,
int line,
boolean strictQuotes)
reader - the reader to an underlying CSV source.separator - the delimiter to use for separating entriesquotechar - the character to use for quoted elementsescape - the character to use for escaping a separator or quoteline - the line number to skip for start readingstrictQuotes - sets if characters outside the quotes are ignoredpublic CSVReader(java.io.Reader reader,
char separator,
char quotechar,
char escape,
int line,
boolean strictQuotes,
boolean ignoreLeadingWhiteSpace)
reader - the reader to an underlying CSV source.separator - the delimiter to use for separating entriesquotechar - the character to use for quoted elementsescape - the character to use for escaping a separator or quoteline - the line number to skip for start readingstrictQuotes - sets if characters outside the quotes are ignoredignoreLeadingWhiteSpace - it true, parser should ignore white space before a quote in a fieldpublic java.util.List<java.lang.String[]> readAll()
throws java.io.IOException
java.io.IOException - IOExceptionpublic java.lang.String[] readNext()
throws java.io.IOException
java.io.IOException - IOExceptionpublic void close()
throws java.io.IOException
close 在接口中 java.io.Closeableclose 在接口中 java.lang.AutoCloseablejava.io.IOException - IOExceptionpublic boolean hasNext()