|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.squirrel_sql.plugins.dataimport.importer.csv.CSVFileImporter
public class CSVFileImporter
This class implements the IFileImporter interface for reading CSV files.
| Constructor Summary | |
|---|---|
CSVFileImporter(File importFile)
The standard constructor |
|
| Method Summary | |
|---|---|
boolean |
close()
Closes the file. |
JComponent |
getConfigurationPanel()
This method returns the panel that is used to configure the importer. |
Date |
getDate(int column)
Returns the given column as a date |
Integer |
getInt(int column)
Returns the given column as an integer |
Long |
getLong(int column)
Returns the given column as a long |
String[][] |
getPreview(int noOfLines)
Returns a preview of the importer's data in string format |
int |
getRows()
Returns the number of rows in the file. |
String |
getString(int column)
Returns the given column as a string |
boolean |
next()
Moves the file pointer to the next row. |
boolean |
open()
Opens the file. |
boolean |
reset()
Resets the file pointer to the first row. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CSVFileImporter(File importFile)
importFile - The import file| Method Detail |
|---|
public boolean open()
throws IOException
IFileImporter
open in interface IFileImportertrue on success, false otherwise
IOException - If an I/O error occurs, this exception is thrown
public boolean close()
throws IOException
IFileImporter
close in interface IFileImportertrue on success, false otherwise
IOException - If an I/O error occurs, this exception is thrown
public String[][] getPreview(int noOfLines)
throws IOException
IFileImporter
getPreview in interface IFileImporternoOfLines - The lines to return
IOException - If an error reading the import file occurred.public int getRows()
IFileImporter
getRows in interface IFileImporter
public boolean next()
throws IOException
IFileImporter
next in interface IFileImportertrue on success, false otherwise
IOException - If an I/O error occurs, this exception is thrown
public boolean reset()
throws IOException
IFileImporter
reset in interface IFileImportertrue on success, false otherwise
IOException - If an I/O error occurs, this exception is thrown
public String getString(int column)
throws IOException
IFileImporter
getString in interface IFileImportercolumn - The column number to retrieve
IOException - If an I/O error occurs, this exception is thrown
public Long getLong(int column)
throws IOException,
UnsupportedFormatException
IFileImporter
getLong in interface IFileImportercolumn - The column number to retrieve
IOException - If an I/O error occurs, this exception is thrown
UnsupportedFormatException - If the column cannot be converted to a
long
public Integer getInt(int column)
throws IOException,
UnsupportedFormatException
IFileImporter
getInt in interface IFileImportercolumn - The column number to retrieve
IOException - If an I/O error occurs, this exception is thrown
UnsupportedFormatException - If the column cannot be converted to an
integer
public Date getDate(int column)
throws IOException,
UnsupportedFormatException
IFileImporter
getDate in interface IFileImportercolumn - The column number to retrieve
IOException - If an I/O error occurs, this exception is thrown
UnsupportedFormatException - If the column cannot be converted to a
datepublic JComponent getConfigurationPanel()
IFileImporter
getConfigurationPanel in interface IFileImporternull to
signal, that no configuration is possible and no dialog should be shown.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||