@PublicEvolving public class StringParser extends FieldParser<String>
String
. The byte contents between
delimiters is interpreted as an ASCII string. The string may be quoted in double quotes. For
quoted strings, whitespaces (space and tab) leading and trailing before and after the quotes are
removed.FieldParser.ParseErrorState
Constructor and Description |
---|
StringParser() |
Modifier and Type | Method and Description |
---|---|
String |
createValue()
Returns an instance of the parsed value type.
|
void |
enableQuotedStringParsing(byte quoteCharacter) |
String |
getLastResult()
Gets the parsed field.
|
int |
parseField(byte[] bytes,
int startPos,
int limit,
byte[] delimiter,
String reusable)
Each parser's logic should be implemented inside this method
|
delimiterNext, endsWithDelimiter, getCharset, getErrorState, getParserForType, nextStringEndPos, nextStringLength, resetErrorStateAndParse, resetParserState, setCharset, setErrorState
public void enableQuotedStringParsing(byte quoteCharacter)
public int parseField(byte[] bytes, int startPos, int limit, byte[] delimiter, String reusable)
FieldParser
parseField
in class FieldParser<String>
public String createValue()
FieldParser
createValue
in class FieldParser<String>
public String getLastResult()
FieldParser
FieldParser.parseField(byte[], int, int, byte[], Object)
. It objects are mutable and reused,
it will return the object instance that was passed the parse function.getLastResult
in class FieldParser<String>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.