InputAnalysisProcess to detect column delimiters, quotes and quote escapes in a CSV input.
| Modifier and Type | Field and Description |
|---|---|
| private char[] | |
| private final char | |
| private char[] | |
| private final int | |
| private final char | |
| private final char | |
| private final char | |
| private final char | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | CsvFormatDetector(int
the number of row samples to collect before analyzing the statistics maxRowSamples, CsvParserSettings the configuration provided by the user with potential defaults in case the detection is unable to discover the proper column
delimiter or quote character. settings, int starting range of characters considered to be whitespace. whitespaceRangeStart)Builds a new |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract void | |
| protected Map | |
| public void | execute(char[]
the input buffer characters, int the last character position loaded into the buffer. length)Implements com. |
| protected char | Returns: the character with the highest/lowest number associated.the map of characters and their numbers map, Map<Character, Integer> totals, char the default character to return in case the map is empty defaultChar, boolean a flag indicating whether to return the character associated with the lowest number in the map.
If min)false then the character associated with the highest number found will be returned.Returns the character with the highest or lowest associated number. |
| protected void | |
| protected void | |
| protected boolean | |
| protected boolean | |
| protected char | |
| protected char | |
| protected char |
| allowedDelimiters | back to summary |
|---|---|
| private char[] allowedDelimiters | |
| comment | back to summary |
|---|---|
| private final char comment | |
| delimiterPreference | back to summary |
|---|---|
| private char[] delimiterPreference | |
| MAX_ROW_SAMPLES | back to summary |
|---|---|
| private final int MAX_ROW_SAMPLES | |
| normalizedNewLine | back to summary |
|---|---|
| private final char normalizedNewLine | |
| suggestedDelimiter | back to summary |
|---|---|
| private final char suggestedDelimiter | |
| suggestedQuote | back to summary |
|---|---|
| private final char suggestedQuote | |
| suggestedQuoteEscape | back to summary |
|---|---|
| private final char suggestedQuoteEscape | |
| whitespaceRangeStart | back to summary |
|---|---|
| private final int whitespaceRangeStart | |
| CsvFormatDetector | back to summary |
|---|---|
| public CsvFormatDetector(int maxRowSamples, CsvParserSettings settings, int whitespaceRangeStart) Builds a new
| |
| apply | back to summary |
|---|---|
| protected abstract void apply(char delimiter, char quote, char quoteEscape) Applies the discovered CSV format elements to the
| |
| calculateTotals | back to summary |
|---|---|
| protected Map | |
| execute | back to summary |
|---|---|
| public void execute(char[] characters, int length) Implements com. Doc from com. A sequence of characters of the input buffer to be analyzed.
| |
| getChar | back to summary |
|---|---|
| protected char getChar(Map<Character, Integer> map, Map<Character, Integer> totals, char defaultChar, boolean min) Returns the character with the highest or lowest associated number.
| |
| increment | back to summary |
|---|---|
| protected void increment(Map<Character, Integer> map, char symbol) Increments the number associated with a character in a map by 1 | |
| increment | back to summary |
|---|---|
| protected void increment(Map<Character, Integer> map, char symbol, int incrementSize) Increments the number associated with a character in a map | |
| isAllowedDelimiter | back to summary |
|---|---|
| protected boolean isAllowedDelimiter(char ch) | |
| isSymbol | back to summary |
|---|---|
| protected boolean isSymbol(char ch) | |
| max | back to summary |
|---|---|
| protected char max(Map<Character, Integer> map, Map<Character, Integer> totals, char defaultChar) Returns the character with the highest associated number. | |
| min | back to summary |
|---|---|
| protected char min(Map<Character, Integer> map, Map<Character, Integer> totals, char defaultChar) Returns the character with the lowest associated number. | |
| pickDelimiter | back to summary |
|---|---|
| protected char pickDelimiter(Map<Character, Integer> sums, Map<Character, Integer> totals) | |