CSVRecordReader Class (Extends RecordReader)

Overview

We can see that most of the detailed work is performed by the CSVRecordReader class. It inherits several attributes and methods from its RecordReader and RecordHandler base classes (see Chapter 6). Here is a summary of its extensions to those classes. We'll review each of the methods.

Attributes:

  • DOM Nodelist Column Grammars

  • Character or Byte Column Delimiter

  • Character or Byte Text Delimiter

  • Integer Column Number

  • Integer Grammar Index

  • Integer Parsing State

Methods:

  • Constructor

  • parseRecord

  • saveCharacter

Note: In the Java and C++ implementations we also enumerate class-wide constants for the parsing states used by the parseRecord method.

Methods

Constructor

Here is the logic for the CSVRecordReader ...

Get Using XML with Legacy Business Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.