public class JCardReader extends StreamReader
Parses VCard
objects from a JSON data stream (jCard format).
Example:
Path file = Paths.get("vcards.json"); try (JCardReader reader = new JCardReader(file)) { VCard vcard; while ((vcard = reader.readNext()) != null) { //... } }
context, index, warnings
Constructor and Description |
---|
JCardReader(InputStream in) |
JCardReader(com.fasterxml.jackson.core.JsonParser parser) |
JCardReader(Path file) |
JCardReader(Reader reader) |
JCardReader(String json) |
Modifier and Type | Method and Description |
---|---|
protected VCard |
_readNext()
Reads the next vCard from the data stream.
|
void |
close() |
assignLabels, getScribeIndex, getWarnings, readAll, readNext, registerScribe, setScribeIndex
public JCardReader(String json)
json
- the JSON string to read frompublic JCardReader(InputStream in)
in
- the input stream to read frompublic JCardReader(Path file) throws IOException
file
- the file to read fromIOException
- if there is a problem reading the filepublic JCardReader(Reader reader)
reader
- the reader to read frompublic JCardReader(com.fasterxml.jackson.core.JsonParser parser)
parser
- the parser to read fromprotected VCard _readNext() throws IOException
StreamReader
_readNext
in class StreamReader
IOException
- if there's a problem reading from the streampublic void close() throws IOException
IOException
Copyright © 2012–2023 Michael Angstadt. All rights reserved.