org.relique.jdbc.csv
Class CsvRawReader
java.lang.Object
org.relique.jdbc.csv.CsvRawReader
public class CsvRawReader
- extends Object
This class is a helper class that handles the reading and parsing of data
from a .csv file.
- Author:
- Jonathan Ackerman, Sander Brienen, Stuart Mottram (fritto), Jason Bedell, Tomasz Skutnik, Christoph Langer, Chetan Gupta
Constructor Summary |
CsvRawReader(LineNumberReader in,
String tableName,
String tableAlias,
String separator,
boolean suppressHeaders,
boolean isHeaderFixedWidth,
Character quoteChar,
String comment,
String headerLine,
boolean trimHeaders,
boolean trimValues,
int skipLeadingLines,
boolean ignoreUnparseableLines,
String missingValue,
boolean defectiveHeaders,
int skipLeadingDataLines,
String quoteStyle,
ArrayList<int[]> fixedWidthColumns)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CsvRawReader
public CsvRawReader(LineNumberReader in,
String tableName,
String tableAlias,
String separator,
boolean suppressHeaders,
boolean isHeaderFixedWidth,
Character quoteChar,
String comment,
String headerLine,
boolean trimHeaders,
boolean trimValues,
int skipLeadingLines,
boolean ignoreUnparseableLines,
String missingValue,
boolean defectiveHeaders,
int skipLeadingDataLines,
String quoteStyle,
ArrayList<int[]> fixedWidthColumns)
throws IOException,
SQLException
- Throws:
IOException
SQLException
next
public boolean next()
throws SQLException
- Throws:
SQLException
close
public void close()
getNextDataLine
protected String getNextDataLine()
throws IOException
- Returns:
- The first next data line that contains the correct amount of
columns. An amount of column is considered correct if it matches
columnNames or if no columnNames is given and the amount is more
than 1.
- Throws:
IOException
- if reading next line fails.
getLineNumber
public int getLineNumber()
getColumnNames
public String[] getColumnNames()
- Gets the columnNames attribute of the CsvReader object.
- Returns:
- The columnNames value.
getColumnSizes
public int[] getColumnSizes()
getTableName
public String getTableName()
getTableAlias
public String getTableAlias()
getFieldValues
public String[] getFieldValues()
getField
public String getField(int columnIndex)
- Get the value of the column at the specified index, 0 based.
- Parameters:
columnIndex
- Description of Parameter.
- Returns:
- The column value.
parseLine
protected String[] parseLine(String line,
boolean trimValues)
throws SQLException
- Throws:
SQLException
Copyright © 2016. All rights reserved.