|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.ui.aribaweb.util.CSVReader
public final class CSVReader
CSVReader parses files in CSV (comma separated values) format. Subclassers should implement the consumeLineOfTokens method.
Constructor Summary | |
---|---|
CSVReader(CSVConsumer csvConsumer)
Create a new CSVReader using a specific CSVConsumer to handle the rows. |
Method Summary | |
---|---|
java.lang.String |
getEncoding()
Return the encoding used for the last read operation. |
boolean |
isEncodingExplicitlySet()
Returns true if the file had the encoding as the first line in the file, e.g. |
void |
read(java.io.File file,
java.lang.String encoding)
Reads the specified file, using the character encoding for the default locale. |
void |
read(java.io.Reader reader,
java.lang.String location)
The primitive read entry point. |
void |
read(java.net.URL url,
java.lang.String defaultEncoding)
Reads the specified URL, using the character encoding for the default locale. |
void |
readForSpecifiedEncoding(java.io.File file)
Will read from the specified stream in the encoding specified on the first line of the stream. |
void |
readForSpecifiedEncoding(java.io.InputStream inputStream,
java.lang.String location)
Will read from the specified stream in the encoding specified on the first line of the stream. |
void |
readForSpecifiedEncoding(java.net.URL url)
Will read from the specified stream in the encoding specified on the first line of the stream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CSVReader(CSVConsumer csvConsumer)
Method Detail |
---|
public java.lang.String getEncoding()
public boolean isEncodingExplicitlySet()
public void read(java.net.URL url, java.lang.String defaultEncoding) throws java.io.IOException
url
- the URL to read the data fromdefaultEncoding
- the encoding to use to read the data if
none can be determined from the URLConnection
java.io.IOException
- any IOException reading from the URLpublic void read(java.io.File file, java.lang.String encoding) throws java.io.IOException
file
- a path to the file to readencoding
- The encoding used for reading the file
java.io.IOException
- any IOException reading from the file
could not be read.public void readForSpecifiedEncoding(java.net.URL url) throws java.io.IOException
url
- the URL to read the data from
java.io.IOException
- any IOException reading from the URLpublic final void readForSpecifiedEncoding(java.io.File file) throws java.io.IOException
file
- the path to the file to read
java.io.IOException
- if an IOException occurs while reading
the fileread(Reader, String)
public final void readForSpecifiedEncoding(java.io.InputStream inputStream, java.lang.String location) throws java.io.IOException
inputStream
- the InputStream to read the data fromlocation
- the path to the data source for debugging messages
java.io.IOException
- if an IOException occurs while reading
the fileread(Reader, String)
public final void read(java.io.Reader reader, java.lang.String location) throws java.io.IOException
reader
- the data source as passed in by one of the
higher level read methodslocation
- the path for debugging messages
java.io.IOException
- if an IOException occurs while reading
from readerCSVConsumer.consumeLineOfTokens(java.lang.String, int, java.util.List)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |