public class CSVConfigGuesser
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected CSVConfig |
config
The found config
|
private boolean |
hasFieldHeader
if the file has a field header (need this info, to be able to guess better)
Defaults to false
|
private java.io.InputStream |
in
The stream to read
|
Constructor and Description |
---|
CSVConfigGuesser() |
CSVConfigGuesser(java.io.InputStream in) |
Modifier and Type | Method and Description |
---|---|
protected void |
analyseLines(java.lang.String[] lines) |
protected java.io.InputStream |
getInputStream()
Allow override.
|
CSVConfig |
guess()
Guess the config based on the first 10 (or less when less available)
records of a CSV file.
|
protected void |
guessFieldSeperator(java.lang.String[] lines) |
protected void |
guessFixedWidth(java.lang.String[] lines)
Guess if this file is fixedwidth.
|
protected void |
guessFixedWidthSeperator(java.lang.String[] lines) |
boolean |
hasFieldHeader() |
void |
setHasFieldHeader(boolean hasFieldHeader)
Specify if the CSV file has a field header
|
void |
setInputStream(java.io.InputStream in) |
private java.io.InputStream in
private boolean hasFieldHeader
protected CSVConfig config
public CSVConfigGuesser()
public CSVConfigGuesser(java.io.InputStream in)
in
- the inputstream to guess frompublic void setInputStream(java.io.InputStream in)
protected java.io.InputStream getInputStream()
public CSVConfig guess()
protected void analyseLines(java.lang.String[] lines)
protected void guessFixedWidth(java.lang.String[] lines)
lines
- protected void guessFieldSeperator(java.lang.String[] lines)
protected void guessFixedWidthSeperator(java.lang.String[] lines)
public boolean hasFieldHeader()
public void setHasFieldHeader(boolean hasFieldHeader)
hasFieldHeader
- true or false