|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.databene.document.csv.CSVTokenizer
public class CSVTokenizer
Parses a CSV file token by token as specified in RFC 4180.
It returns parsed values as CSVTokensType of type CELL, EOL and EOF.
The current cell content is accessible by the public attribute 'cell'.
Created: 26.08.2006 17:19:35
CSVTokenType| Field Summary | |
|---|---|
java.lang.String |
cell
String representation of the cell at the cursor position. |
static char |
DEFAULT_SEPARATOR
The default separator to use |
int |
endColumn
|
CSVTokenType |
lastType
|
int |
line
|
int |
startColumn
|
CSVTokenType |
ttype
The token at the cursor position |
| Constructor Summary | |
|---|---|
CSVTokenizer(java.io.Reader reader)
Creates a tokenizer that reads from a java.io.Reader. |
|
CSVTokenizer(java.io.Reader reader,
char separator)
Creates a tokenizer that reads from a java.io.Reader. |
|
CSVTokenizer(java.lang.String uri)
Creates a tokenizer that reads from a URL. |
|
CSVTokenizer(java.lang.String uri,
char separator)
Creates a tokenizer that reads from a uri. |
|
CSVTokenizer(java.lang.String uri,
char separator,
java.lang.String encoding)
|
|
| Method Summary | |
|---|---|
void |
close()
Closes the source |
CSVTokenType |
lastTtype()
|
CSVTokenType |
next()
Returns the next token. |
void |
skipLine()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final char DEFAULT_SEPARATOR
public CSVTokenType ttype
public CSVTokenType lastType
public java.lang.String cell
public int line
public int startColumn
public int endColumn
| Constructor Detail |
|---|
public CSVTokenizer(java.lang.String uri)
throws java.io.IOException
uri - the URL to read from
java.io.IOException
public CSVTokenizer(java.lang.String uri,
char separator)
throws java.io.IOException
uri - the uri to read fromseparator - character used for separating CSV cells
java.io.IOException
public CSVTokenizer(java.lang.String uri,
char separator,
java.lang.String encoding)
throws java.io.IOException
java.io.IOExceptionpublic CSVTokenizer(java.io.Reader reader)
reader - the reader to use as input
public CSVTokenizer(java.io.Reader reader,
char separator)
reader - the reader to use as inputseparator - character used for separating CSV cells| Method Detail |
|---|
public CSVTokenType next()
throws java.io.IOException
java.io.IOException - if source access fails
public void skipLine()
throws java.io.IOException
java.io.IOExceptionpublic void close()
close in interface java.io.Closeablepublic CSVTokenType lastTtype()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||