public class TextParsingSettings extends Object
| Modifier and Type | Field and Description |
|---|---|
static TextParsingSettings |
DEFAULT |
| Constructor and Description |
|---|
TextParsingSettings() |
| Modifier and Type | Method and Description |
|---|---|
byte |
getComment() |
byte |
getDelimiter()
Returns the field delimiter character.
|
String |
getEmptyValue()
Returns the String representation of an empty value (defaults to null)
|
String |
getLineSeparatorString() |
long |
getMaxCharsPerColumn() |
byte[] |
getNewLineDelimiter() |
byte |
getNormalizedNewLine() |
int |
getNumberOfRecordsToRead()
The number of valid records to be parsed before the process is stopped.
|
byte |
getQuote()
Returns the character used for escaping values where the field delimiter is part of the value.
|
byte |
getQuoteEscape()
Returns the character used for escaping quotes inside an already quoted value.
|
boolean |
isDelimiter(byte ch)
Identifies whether or not a given character represents a field delimiter
|
boolean |
isHeaderExtractionEnabled()
Indicates whether or not the first valid record parsed from the input should be considered as the row containing the names of each column
|
boolean |
isIgnoreLeadingWhitespaces() |
boolean |
isIgnoreTrailingWhitespaces() |
boolean |
isParseUnescapedQuotes()
Indicates whether the CSV parser should accept unescaped quotes inside quoted values and parse them normally.
|
boolean |
isQuote(byte ch)
Identifies whether or not a given character is used for escaping values where the field delimiter is part of the value
|
boolean |
isQuoteEscape(byte ch)
Identifies whether or not a given character is used for escaping quotes inside an already quoted value.
|
boolean |
isSkipFirstLine() |
boolean |
isUseRepeatedVarChar() |
void |
set(TextFormatPlugin.TextFormatConfig config) |
void |
setComment(byte comment) |
void |
setDelimiter(byte delimiter)
Defines the field delimiter character.
|
void |
setEmptyValue(String emptyValue)
Sets the String representation of an empty value (defaults to null)
|
void |
setHeaderExtractionEnabled(boolean headerExtractionEnabled)
Defines whether or not the first valid record parsed from the input should be considered as the row containing the names of each column
|
void |
setIgnoreLeadingWhitespaces(boolean ignoreLeadingWhitespaces) |
void |
setIgnoreTrailingWhitespaces(boolean ignoreTrailingWhitespaces) |
void |
setMaxCharsPerColumn(long maxCharsPerColumn) |
void |
setNormalizedNewLine(byte normalizedNewLine) |
void |
setNumberOfRecordsToRead(int numberOfRecordsToRead)
Defines the number of valid records to be parsed before the process is stopped.
|
void |
setParseUnescapedQuotes(boolean parseUnescapedQuotes)
Configures how to handle unescaped quotes inside quoted values.
|
void |
setQuote(byte quote)
Defines the character used for escaping values where the field delimiter is part of the value.
|
void |
setQuoteEscape(byte quoteEscape)
Defines the character used for escaping quotes inside an already quoted value.
|
void |
setSkipFirstLine(boolean skipFirstLine) |
void |
setUseRepeatedVarChar(boolean useRepeatedVarChar) |
public static final TextParsingSettings DEFAULT
public void set(TextFormatPlugin.TextFormatConfig config)
public byte getComment()
public boolean isSkipFirstLine()
public void setSkipFirstLine(boolean skipFirstLine)
public boolean isUseRepeatedVarChar()
public void setUseRepeatedVarChar(boolean useRepeatedVarChar)
public byte[] getNewLineDelimiter()
public byte getQuote()
public void setQuote(byte quote)
quote - the quote characterpublic String getLineSeparatorString()
public boolean isQuote(byte ch)
ch - the character to be verifiedpublic byte getQuoteEscape()
public void setQuoteEscape(byte quoteEscape)
quoteEscape - the quote escape characterpublic boolean isQuoteEscape(byte ch)
ch - the character to be verifiedpublic byte getDelimiter()
public void setDelimiter(byte delimiter)
delimiter - the field delimiter characterpublic boolean isDelimiter(byte ch)
ch - the character to be verifiedpublic String getEmptyValue()
When reading, if the parser does not read any character from the input, and the input is within quotes, the empty is used instead of an empty string
public void setEmptyValue(String emptyValue)
When reading, if the parser does not read any character from the input, and the input is within quotes, the empty is used instead of an empty string
emptyValue - the String representation of an empty valuepublic boolean isParseUnescapedQuotes()
true.public void setParseUnescapedQuotes(boolean parseUnescapedQuotes)
true, the parser will parse the quote normally as part of the value.
If set the false, a TextParsingException will be thrown. Defaults to true.parseUnescapedQuotes - indicates whether or not the CSV parser should accept unescaped quotes inside quoted values.public boolean isHeaderExtractionEnabled()
public void setHeaderExtractionEnabled(boolean headerExtractionEnabled)
headerExtractionEnabled - a flag indicating whether the first valid record parsed from the input should be considered as the row containing the names of each columnpublic int getNumberOfRecordsToRead()
public void setNumberOfRecordsToRead(int numberOfRecordsToRead)
numberOfRecordsToRead - the number of records to read before stopping the parsing process.public long getMaxCharsPerColumn()
public void setMaxCharsPerColumn(long maxCharsPerColumn)
public void setComment(byte comment)
public byte getNormalizedNewLine()
public void setNormalizedNewLine(byte normalizedNewLine)
public boolean isIgnoreLeadingWhitespaces()
public void setIgnoreLeadingWhitespaces(boolean ignoreLeadingWhitespaces)
public boolean isIgnoreTrailingWhitespaces()
public void setIgnoreTrailingWhitespaces(boolean ignoreTrailingWhitespaces)
Copyright © 2017 The Apache Software Foundation. All rights reserved.