public class CSVParser extends AbstractCSVParser
nullFieldIndicator, pending, quotechar, separatorDEFAULT_BUNDLE_NAME, DEFAULT_ESCAPE_CHARACTER, DEFAULT_IGNORE_LEADING_WHITESPACE, DEFAULT_IGNORE_QUOTATIONS, DEFAULT_NULL_FIELD_INDICATOR, DEFAULT_QUOTE_CHARACTER, DEFAULT_SEPARATOR, DEFAULT_STRICT_QUOTES, INITIAL_READ_SIZE, MAX_SIZE_FOR_EMPTY_FIELD, NEWLINE, NULL_CHARACTER, READ_BUFFER_SIZE| Constructor and Description |
|---|
CSVParser()
Constructs CSVParser using default values for everything.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
convertToCsvValue(String value,
boolean applyQuotestoAll)
Used when reverse parsing an array of strings to a single string.
|
char |
getEscape() |
boolean |
isIgnoreLeadingWhiteSpace() |
boolean |
isIgnoreQuotations() |
protected boolean |
isNextCharacterEscapable(String nextLine,
boolean inQuotes,
int i)
Checks to see if the character after the current index in a String is an
escapable character.
|
boolean |
isStrictQuotes() |
protected String[] |
parseLine(String nextLine,
boolean multi)
Parses an incoming
String and returns an array of elements. |
void |
setErrorLocale(Locale errorLocale)
Sets the locale for all error messages.
|
getPendingText, getQuotechar, getSeparator, isPending, isSurroundWithQuotes, nullFieldIndicator, parseLine, parseLineMulti, parseToLinepublic CSVParser()
public char getEscape()
public boolean isStrictQuotes()
public boolean isIgnoreLeadingWhiteSpace()
public boolean isIgnoreQuotations()
protected String convertToCsvValue(String value, boolean applyQuotestoAll)
AbstractCSVParserconvertToCsvValue in class AbstractCSVParservalue - String to be testedapplyQuotestoAll - All values should be surrounded with quotesprotected String[] parseLine(String nextLine, boolean multi) throws IOException
AbstractCSVParserString and returns an array of elements.parseLine in class AbstractCSVParsernextLine - The string to parsemulti - Whether it takes multiple lines to form a single recordnull if nextLine is nullIOException - If bad things happen during the readprotected boolean isNextCharacterEscapable(String nextLine, boolean inQuotes, int i)
nextLine - The current lineinQuotes - True if the current context is quotedi - Current index in linepublic void setErrorLocale(Locale errorLocale)
ICSVParsererrorLocale - Locale for error messages. If null, the default locale
is used.Copyright © 2019. All rights reserved.