public class JCardRawReader extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
static interface |
JCardRawReader.JCardDataStreamListener
Handles the vCard data as it is read off the data stream.
|
Constructor and Description |
---|
JCardRawReader(com.fasterxml.jackson.core.JsonParser parser,
boolean strict) |
JCardRawReader(Reader reader) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying
Reader object. |
boolean |
eof()
Determines whether the end of the data stream has been reached.
|
int |
getLineNum()
Gets the current line number.
|
void |
readNext(JCardRawReader.JCardDataStreamListener listener)
Reads the next vCard from the jCard data stream.
|
public JCardRawReader(Reader reader)
reader
- the reader to wrappublic JCardRawReader(com.fasterxml.jackson.core.JsonParser parser, boolean strict)
parser
- the parser to read fromstrict
- true if the parser's current token is expected to be
positioned at the start of a jCard, false if not. If this is true, and
the parser is not positioned at the beginning of a jCard, a
JCardParseException
will be thrown. If this if false, the parser
will consume input until it reaches the beginning of a jCard.public int getLineNum()
public void readNext(JCardRawReader.JCardDataStreamListener listener) throws IOException
listener
- handles the vCard data as it is read off the wireJCardParseException
- if the jCard syntax is incorrect (the JSON
syntax may be valid, but it is not in the correct jCard format).com.fasterxml.jackson.core.JsonParseException
- if the JSON syntax is incorrectIOException
- if there is a problem reading from the input streampublic boolean eof()
public void close() throws IOException
Reader
object.close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2012–2023 Michael Angstadt. All rights reserved.