| Modifier and Type | Field and Description |
|---|---|
| protected final CSVReaderNullFieldIndicator | nullFieldIndicator
Determines the handling of null fields. |
| protected String | pending
Value to be appended to string to process. |
| protected final char | quotechar
This is the character that the CSVParser will treat as the quotation character. |
| private final String | quotecharAsString
This is the quotechar in String form to reduce the number of calls to toString. |
| private final String | quoteDoubledAsString
This is quotecharAsString+quotecharAsString - used in replaceAll to reduce the number of strings being created. |
| private final Pattern | quoteMatcherPattern
pattern created to match quotechars - optimizaion of the String.replaceAll. |
| protected final char | separator
This is the character that the CSVParser will treat as the separator. |
| private final String | separatorAsString
This is the separator in String form to reduce the number of calls to toString. |
| Access | Constructor and Description |
|---|---|
| public | AbstractCSVParser(char
The delimiter to use for separating entries separator, char The character to use for quoted elements quotechar, CSVReaderNullFieldIndicator Indicate what should be considered null nullFieldIndicator)Common constructor. |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract String | Returns: String that will go into the CSV stringString to be converted value, boolean All values should be surrounded with quotes applyQuotestoAll)Used when reverse parsing an array of strings to a single string. |
| protected void | convertToCsvValue(String
String to be converted value, boolean All values should be surrounded with quotes applyQuotesToAll, Appendable Appendable object that the converted values are added to. appendable)Used when reverse parsing an array of strings to a single string. |
| public String | getPendingText()
Implements com. If a parser is in the middle of parsing a multiline field, this will return the text collected so far. |
| public char | |
| public String | getQuotecharAsString()
Returns: String version of quotechar to reduce the number of calls to toString. |
| protected final String | Returns: The string representation of the doubled quote character.Returns the doubled quote character as a string representation. |
| protected final Pattern | Returns: ThePattern used for identifying quoted elements.Retrieves the compiled |
| public char | |
| public String | |
| public boolean | |
| protected boolean | Returns: True if the string should be surrounded with quotes, false otherwiseString to be tested value, boolean If the value is not forceSurround)null it will be surrounded with quotesUsed by reverse parsing to determine if a value should be surrounded by quote characters. |
| public CSVReaderNullFieldIndicator | |
| public String[] | parseLine(String nextLine)
Implements com. Parses an incoming String and returns an array of elements. |
| protected abstract String[] | Returns: The list of elements, ornull if nextLine is nullThe string to parse nextLine, boolean Whether it takes multiple lines to form a single record multi)Parses an incoming |
| public String[] | parseLineMulti(String nextLine)
Implements com. Parses an incoming String and returns an array of elements. |
| public String | parseToLine(String[] values, boolean applyQuotesToAll)
Implements com. Essentially a "Reverse parse" where an array of values are concatenating to a csv delimited string. |
| public void | parseToLine(String[] values, boolean applyQuotesToAll, Appendable appendable)
Implements com. Essentially a "Reverse parse" where an array of values are concatenating to a csv delimited string. |
| nullFieldIndicator | back to summary |
|---|---|
| protected final CSVReaderNullFieldIndicator nullFieldIndicator Determines the handling of null fields.
| |
| pending | back to summary |
|---|---|
| protected String pending Value to be appended to string to process. | |
| quotechar | back to summary |
|---|---|
| protected final char quotechar This is the character that the CSVParser will treat as the quotation character. | |
| quotecharAsString | back to summary |
|---|---|
| private final String quotecharAsString This is the quotechar in String form to reduce the number of calls to toString. | |
| quoteDoubledAsString | back to summary |
|---|---|
| private final String quoteDoubledAsString This is quotecharAsString+quotecharAsString - used in replaceAll to reduce the number of strings being created. | |
| quoteMatcherPattern | back to summary |
|---|---|
| private final Pattern quoteMatcherPattern pattern created to match quotechars - optimizaion of the String.replaceAll. | |
| separator | back to summary |
|---|---|
| protected final char separator This is the character that the CSVParser will treat as the separator. | |
| separatorAsString | back to summary |
|---|---|
| private final String separatorAsString This is the separator in String form to reduce the number of calls to toString. | |
| AbstractCSVParser | back to summary |
|---|---|
| public AbstractCSVParser(char separator, char quotechar, CSVReaderNullFieldIndicator nullFieldIndicator) Common constructor.
| |
| convertToCsvValue | back to summary |
|---|---|
| protected abstract String convertToCsvValue(String value, boolean applyQuotestoAll) Used when reverse parsing an array of strings to a single string. Handles the application of quotes around the string and handling any quotes within the string. | |
| convertToCsvValue | back to summary |
|---|---|
| protected void convertToCsvValue(String value, boolean applyQuotesToAll, Appendable appendable) throws IOException Used when reverse parsing an array of strings to a single string. Handles the application of quotes around the string and handling any quotes within the string. Note as of 5.7.2 most objects will be inheriting a solution that calls the existing convertToCsvValue and thus will not receive much benefit.
| |
| getPendingText | back to summary |
|---|---|
| public String getPendingText() Implements com. Doc from com. If a parser is in the middle of parsing a multiline field, this will return the text collected so far.
| |
| getQuotechar | back to summary |
|---|---|
| public char getQuotechar() Implements com.
| |
| getQuotecharAsString | back to summary |
|---|---|
public String getQuotecharAsString()
| |
| getQuoteDoubledAsString | back to summary |
|---|---|
| protected final String getQuoteDoubledAsString() Returns the doubled quote character as a string representation.
| |
| getQuoteMatcherPattern | back to summary |
|---|---|
| protected final Pattern getQuoteMatcherPattern() Retrieves the compiled | |
| getSeparator | back to summary |
|---|---|
| public char getSeparator() Implements com.
| |
| getSeparatorAsString | back to summary |
|---|---|
public String getSeparatorAsString()
| |
| isPending | back to summary |
|---|---|
| public boolean isPending() Implements com.
| |
| isSurroundWithQuotes | back to summary |
|---|---|
| protected boolean isSurroundWithQuotes(String value, boolean forceSurround) Used by reverse parsing to determine if a value should be surrounded by quote characters.
| |
| nullFieldIndicator | back to summary |
|---|---|
| public CSVReaderNullFieldIndicator nullFieldIndicator() Implements com.
| |
| parseLine | back to summary |
|---|---|
| public String[] parseLine(String nextLine) throws IOException Implements com. Doc from com. Parses an incoming String and returns an array of elements. This method is used when all data is contained in a single line.
| |
| parseLine | back to summary |
|---|---|
| protected abstract String[] parseLine(String nextLine, boolean multi) throws IOException Parses an incoming
| |
| parseLineMulti | back to summary |
|---|---|
| public String[] parseLineMulti(String nextLine) throws IOException Implements com. Doc from com. Parses an incoming String and returns an array of elements. This method is used when the data spans multiple lines.
| |
| parseToLine | back to summary |
|---|---|
| public String parseToLine(String[] values, boolean applyQuotesToAll) Implements com. Doc from com. Essentially a "Reverse parse" where an array of values are concatenating to a csv delimited string.
| |
| parseToLine | back to summary |
|---|---|
| public void parseToLine(String[] values, boolean applyQuotesToAll, Appendable appendable) throws IOException Implements com. Doc from com. Essentially a "Reverse parse" where an array of values are concatenating to a csv delimited string. Note This functionality is for testing only in the 5.7.2 release in an effort to optimize the number of strings created when parsing large files.
| |