It handles all settings defined by CommonParserSettings, and delegates the parsing algorithm implementation to its subclasses through the
abstract method AbstractParser#parseRecord()
The following (absolutely required) attributes are exposed to subclasses:
CharInputReader): the character input provider that reads characters from a given input into an internal bufferParserOutput): the output handler for every record parsed from the input. Implementors must use this object to handle the input (such as appending characters and notifying of values parsed)com.univocity.parsers.csv.CsvParser , com.univocity.parsers.csv.CsvParserSettings , com.univocity.parsers.fixed.FixedWidthParser , com.univocity.parsers.fixed.FixedWidthParserSettings , com.univocity.parsers.common.input.CharInputReader , com.univocity.parsers.common.ParserOutput
| Modifier and Type | Field and Description |
|---|---|
| protected char | |
| private final boolean | |
| protected final char | |
| protected final Map | |
| protected ParsingContext | |
| private final int | |
| private final ProcessorErrorHandler | |
| private final boolean | |
| private boolean | |
| protected boolean | |
| protected boolean | |
| protected CharInputReader | |
| protected String | |
| private final LineReader | |
| protected final ParserOutput | |
| private final boolean | |
| protected Processor | |
| private final long | |
| private final long | |
| protected final T | |
| protected final int |
| Access | Constructor and Description |
|---|---|
| public | AbstractParser(T
the parser configuration settings)All parsers must support, at the very least, the settings provided by |
| Modifier and Type | Method and Description |
|---|---|
| private <T> List | |
| public final void | |
| public final void | |
| public final void | beginParsing(File
The file to be parsed. file, String the encoding of the file encoding)Starts an iterator-style parsing cycle. |
| public final void | beginParsing(File
The file to be parsed. file, Charset the encoding of the file encoding)Starts an iterator-style parsing cycle. |
| public final void | beginParsing(InputStream
The input to be parsed. The input stream will be closed automatically in case of errors unless
input)CommonParserSettings#isAutoClosingEnabled() evaluates to false.Starts an iterator-style parsing cycle. |
| public final void | beginParsing(InputStream
The input to be parsed. The input stream will be closed automatically in case of errors unless
input, String CommonParserSettings#isAutoClosingEnabled() evaluates to false.the encoding of the input stream encoding)Starts an iterator-style parsing cycle. |
| public final void | beginParsing(InputStream
The input to be parsed. The input stream will be closed automatically in case of errors unless
input, Charset CommonParserSettings#isAutoClosingEnabled() evaluates to false.the encoding of the input stream encoding)Starts an iterator-style parsing cycle. |
| protected boolean | Returns: a flag indicating whether the parser was processing a value when the end of the input was reached.Allows the parser implementation to handle any value that was being consumed when the end of the input was reached |
| protected ParsingContext | |
| pack-priv void | |
| pack-priv final Map | Returns: a map containing the line numbers and comments found in each.Returns all comments collected by the parser so far. |
| public final ParsingContext | Returns: the parsing contextReturns the current parsing context with information about the status of the parser at any given time. |
| protected InputAnalysisProcess | Returns: a custom implementation ofInputAnalysisProcess. By default, null is returned and no special input analysis will be performed.Allows the parser implementation to traverse the input buffer before the parsing process starts, in order to enable automatic configuration and discovery of data formats. |
| pack-priv final String | Returns: the last comment found in the input.Returns the last comment found in the input. |
| private String | |
| pack-priv final String[] | Returns: the headers parsed from the input, whenCommonParserSettings#headerExtractionEnabled is true.Returns the headers parsed from the input, if and only if |
| public final RecordMetaData | Returns: the metadata ofcom.s generated with the current input.Returns the metadata associated with |
| private String[] | |
| private TextParsingException | |
| protected boolean | |
| protected void | |
| private final List | |
| private List | |
| public final IterableResult | Returns: an iterator for rows parsed from the input.the input input, String Filethe encoding of the input encoding)FileProvides an |
| public final IterableResult | Returns: an iterator for rows parsed from the input.the input input, final Charset Filethe encoding of the input encoding)FileProvides an |
| public final IterableResult | Returns: an iterator for rows parsed from the input.the input input)FileProvides an |
| public final IterableResult | Returns: aniterable over the results of parsing the Readerthe input input)ReaderProvides an |
| public final IterableResult | Returns: an iterator for rows parsed from the input.the the input, String InputStream with contents to be parsedthe character encoding to be used for processing the given input. encoding)Provides an |
| public final IterableResult | Returns: an iterator for rows parsed from the input.the the input, final Charset InputStream with contents to be parsedthe character encoding to be used for processing the given input. encoding)Provides an |
| public final IterableResult | Returns: an iterator for rows parsed from the input.the the input)InputStream with contents to be parsedProvides an |
| public final IterableResult | Returns: an iterator for records parsed from the input.the input input, String Filethe encoding of the input encoding)FileProvides an |
| public final IterableResult | Returns: an iterator for records parsed from the input.the input input, final Charset Filethe encoding of the input encoding)FileProvides an |
| public final IterableResult | Returns: an iterator for records parsed from the input.the input input)FileProvides an |
| public final IterableResult | Returns: an iterator for records parsed from the input.the input input)ReaderProvides an |
| public final IterableResult | Returns: an iterator for records parsed from the input.the the input, String InputStream with contents to be parsedthe character encoding to be used for processing the given input. encoding)Provides an |
| public final IterableResult | Returns: an iterator for records parsed from the input.the the input, final Charset InputStream with contents to be parsedthe character encoding to be used for processing the given input. encoding)Provides an |
| public final IterableResult | Returns: an iterator for records parsed from the input.the the input)InputStream with contents to be parsedProvides an |
| public final void | parse(Reader
The input to be parsed. reader)Parses the entirety of a given input and delegates each parsed row to an instance of |
| public final void | parse(File
The file to be parsed. file)Parses the entirety of a given file and delegates each parsed row to an instance of |
| public final void | parse(File
The file to be parsed. file, String the encoding of the file encoding)Parses the entirety of a given file and delegates each parsed row to an instance of |
| public final void | parse(File
The file to be parsed. file, Charset the encoding of the file encoding)Parses the entirety of a given file and delegates each parsed row to an instance of |
| public final void | parse(InputStream
The input to be parsed. The input stream will be closed automatically, unless input)CommonParserSettings#isAutoClosingEnabled() evaluates
to false.Parses the entirety of a given input and delegates each parsed row to an instance of |
| public final void | parse(InputStream
The input to be parsed. The input stream will be closed automatically, unless input, String CommonParserSettings#isAutoClosingEnabled()
evaluates to false.the encoding of the input stream encoding)Parses the entirety of a given input and delegates each parsed row to an instance of |
| public final void | parse(InputStream
The input to be parsed. The input stream will be closed automatically, unless input, Charset CommonParserSettings#isAutoClosingEnabled()
evaluates to false.the encoding of the input stream encoding)Parses the entirety of a given input and delegates each parsed row to an instance of |
| public List | |
| public List | Returns: the list of all remaining records parsed from the input.Parses all remaining rows from the input and returns them in a list. |
| public final List | |
| public final List | |
| public final List | |
| public final List | Returns: the list of all records parsed from the file.the input file to be parsed file, String the encoding of the file encoding, int expected number of rows to be parsed from the input.
Used to pre-allocate the size of the output expectedRowCount)ListParses all records from a file and returns them in a list. |
| public final List | Returns: the list of all records parsed from the file.the input file to be parsed file, Charset the encoding of the file encoding, int expected number of rows to be parsed from the input.
Used to pre-allocate the size of the output expectedRowCount)ListParses all records from a file and returns them in a list. |
| public final List | Returns: the list of all records parsed from the input.the input stream to be parsed. The input stream will be closed automatically unless
input, int CommonParserSettings#isAutoClosingEnabled() evaluates to falseexpected number of rows to be parsed from the input.
Used to pre-allocate the size of the output expectedRowCount)ListParses all records from an input stream and returns them in a list. |
| public final List | Returns: the list of all records parsed from the input.the input stream to be parsed. The input stream will be closed automatically unless
input, String CommonParserSettings#isAutoClosingEnabled() evaluates to falsethe encoding of the input stream encoding, int expected number of rows to be parsed from the input.
Used to pre-allocate the size of the output expectedRowCount)ListParses all records from an input stream and returns them in a list. |
| public final List | Returns: the list of all records parsed from the input.the input stream to be parsed. The input stream will be closed automatically unless
input, Charset CommonParserSettings#isAutoClosingEnabled() evaluates to falsethe encoding of the input stream encoding, int expected number of rows to be parsed from the input.
Used to pre-allocate the size of the output expectedRowCount)ListParses all records from an input stream and returns them in a list. |
| public final List | |
| public final List | |
| public final List | |
| public final List | Returns: the list of all records parsed from the input.the input stream to be parsed. The input stream will be closed automatically unless input)CommonParserSettings#isAutoClosingEnabled()
evaluates to falseParses all records from an input stream and returns them in a list. |
| public final List | Returns: the list of all records parsed from the input.the input stream to be parsed. The input stream will be closed automatically unless input, String CommonParserSettings#isAutoClosingEnabled()
evaluates to falsethe encoding of the input stream encoding)Parses all records from an input stream and returns them in a list. |
| public final List | Returns: the list of all records parsed from the input.the input stream to be parsed. The input stream will be closed automatically unless input, Charset CommonParserSettings#isAutoClosingEnabled()
evaluates to falsethe encoding of the input stream encoding)Parses all records from an input stream and returns them in a list. |
| public List | Returns: the list of all remaining records parsed from the input.expected number of expectedRowCount)com.s to be parsed from the input.
Used to pre-allocate the size of the output ListParses all remaining |
| public List | Returns: the list of all remainingcom.s parsed from the input.Parses all remaining |
| public final List | Returns: the list of all records parsed from the file.the input file to be parsed file, int expected number of rows to be parsed from the input.
Used to pre-allocate the size of the output expectedRowCount)ListParses all records from a file and returns them in a list. |
| public final List | Returns: the list of all records parsed from the file.the input file to be parsed file, String the encoding of the file encoding, int expected number of rows to be parsed from the input.
Used to pre-allocate the size of the output expectedRowCount)ListParses all records from a file and returns them in a list. |
| public final List | Returns: the list of all records parsed from the file.the input file to be parsed file, Charset the encoding of the file encoding, int expected number of rows to be parsed from the input.
Used to pre-allocate the size of the output expectedRowCount)ListParses all records from a file and returns them in a list. |
| public final List | Returns: the list of all records parsed from the input.the input stream to be parsed. The input stream will be closed automatically unless
input, int CommonParserSettings#isAutoClosingEnabled() evaluates to falseexpected number of rows to be parsed from the input.
Used to pre-allocate the size of the output expectedRowCount)ListParses all records from an input stream and returns them in a list. |
| public final List | Returns: the list of all records parsed from the input.the input stream to be parsed. The input stream will be closed automatically unless
input, String CommonParserSettings#isAutoClosingEnabled() evaluates to falsethe encoding of the input stream encoding, int expected number of rows to be parsed from the input.
Used to pre-allocate the size of the output expectedRowCount)ListParses all records from an input stream and returns them in a list. |
| public final List | Returns: the list of all records parsed from the input.the input stream to be parsed. The input stream will be closed automatically unless
input, Charset CommonParserSettings#isAutoClosingEnabled() evaluates to falsethe encoding of the input stream encoding, int expected number of rows to be parsed from the input.
Used to pre-allocate the size of the output expectedRowCount)ListParses all records from an input stream and returns them in a list. |
| public final List | Returns: the list of all records parsed from the file.the input file to be parsed file)Parses all records from a file and returns them in a list. |
| public final List | Returns: the list of all records parsed from the file.the input file to be parsed file, String the encoding of the file encoding)Parses all records from a file and returns them in a list. |
| public final List | Returns: the list of all records parsed from the file.the input file to be parsed file, Charset the encoding of the file encoding)Parses all records from a file and returns them in a list. |
| public final List | Returns: the list of all records parsed from the input.the input stream to be parsed. The input stream will be closed automatically unless input)CommonParserSettings#isAutoClosingEnabled()
evaluates to falseParses all records from an input stream and returns them in a list. |
| public final List | Returns: the list of all records parsed from the input.the input stream to be parsed. The input stream will be closed automatically unless input, String CommonParserSettings#isAutoClosingEnabled()
evaluates to falsethe encoding of the input stream encoding)Parses all records from an input stream and returns them in a list. |
| public final List | Returns: the list of all records parsed from the input.the input stream to be parsed. The input stream will be closed automatically unless input, Charset CommonParserSettings#isAutoClosingEnabled()
evaluates to falsethe encoding of the input stream encoding)Parses all records from an input stream and returns them in a list. |
| public final List | Returns: the list of all records parsed from the input.the input to be parsed reader, int expected number of rows to be parsed from the input.
Used to pre-allocate the size of the output expectedRowCount)ListParses all records from the input and returns them in a list. |
| public final List | Returns: the list of all records parsed from the input.the input to be parsed reader)Parses all records from the input and returns them in a list. |
| public final String[] | |
| public final String[] | Returns: The record parsed from the input or null if there's no more characters to read.Parses the next record from the input. |
| public final Record | Returns: The record parsed from the input or null if there's no more characters to read.Parses the next record from the input. |
| protected abstract void | |
| public final Record | Returns: thecom. containing the values parsed from the input linea line of text to be parsed line)Parses a single line from a String in the format supported by the parser implementation. |
| protected void | |
| protected final void | |
| private void | |
| private void | |
| public final void |