public class JsonReader extends JsonReaderSupport implements RecordReader
RecordReader
implementation for JSON formatted records.JsonRecordParserFactory
eof, in
Constructor and Description |
---|
JsonReader(Reader in)
Constructs a new JsonReader.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this input stream.
|
int |
getRecordLineNumber()
Returns the line number of the last record from this input stream.
|
String |
getRecordText()
Returns the unparsed record text of the last record read.
|
static void |
main(String[] args) |
Map<String,Object> |
read()
Reads a single record from this input stream.
|
isWhitespace, parseValue, readArray, readObject, readString, readUnicode, setReader
public Map<String,Object> read() throws IOException, RecordIOException
RecordReader
read
in interface RecordReader
IOException
- if an I/O error occurs reading from the streamRecordIOException
- if the record is malformed and cannot
be parsed, but subsequent reads may still be possiblepublic void close() throws IOException
RecordReader
close
in interface RecordReader
IOException
- if an I/O error occurs closing the streampublic int getRecordLineNumber()
RecordReader
getRecordLineNumber
in interface RecordReader
public String getRecordText()
RecordReader
getRecordText
in interface RecordReader