public class IlvCSVReader extends Object
DefaultTableModel
.Modifier and Type | Field and Description |
---|---|
static char |
AUTO
The reader will try to automatically discover the right separator to use.
|
static char |
COMMA
Commas will be considered as separator characters.
|
static char |
SEMICOLON
Semicolons will be considered as separator characters.
|
static char |
SPACE
Spaces will be considered as separator characters.
|
static char |
TAB
A tabulation will be considered as separator characters.
|
Modifier and Type | Method and Description |
---|---|
static IlvCSVReader |
getInstance()
Returns an instance of
IlvCSVReader that will try to automatically
detect the separator to read a CSV File into a DefaultTableModel . |
static IlvCSVReader |
getInstance(char separator)
Returns an instance of
IlvCSVReader that will use the given
separator to read a CSV File into a DefaultTableModel . |
static IlvCSVReader |
getInstance(char separator,
int titleRowIndex)
Returns an instance of
IlvCSVReader that will use the given
separator to read a CSV File into a DefaultTableModel . |
IlvCSVTableModel |
read(Reader csvFile)
Reads the given CSV File into a
DefaultTableModel that also
implements the IlvTableModel interface. |
DefaultTableModel |
read(Reader csvFile,
DefaultTableModel model)
Reads the given CSV File into the given
DefaultTableModel |
public static final char COMMA
public static final char SEMICOLON
public static final char SPACE
public static final char TAB
public static final char AUTO
public static IlvCSVReader getInstance()
IlvCSVReader
that will try to automatically
detect the separator to read a CSV File into a DefaultTableModel
.IlvCSVReader
instance.public static IlvCSVReader getInstance(char separator)
IlvCSVReader
that will use the given
separator
to read a CSV File into a DefaultTableModel
.
The seperator
can be one of the following:
IlvCSVReader
instance.public static IlvCSVReader getInstance(char separator, int titleRowIndex)
IlvCSVReader
that will use the given
separator
to read a CSV File into a DefaultTableModel
.
The values that will be on row titleRowIndex
will used used
as columns names for the DefaultTableModel
. If titleRowIndex
is negative, no column name will be set.
The seperator
can be one of the following:
IlvCSVReader
instance.public DefaultTableModel read(Reader csvFile, DefaultTableModel model) throws IOException
DefaultTableModel
csvFile
- a Reader
on the CSV File; it will be closed by
this methodmodel
- the model filled with the contents of the CSV File.DefaultTableModel
IOException
- if an IO error occurs.public IlvCSVTableModel read(Reader csvFile) throws IOException
DefaultTableModel
that also
implements the IlvTableModel
interface.csvFile
- a Reader
on the CSV File; it will be closed by
this methodDefaultTableModel
filled with the contents
of the CSV File.IOException
- if an IO error occurs.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.