public class JCardReader extends StreamReader
Parses VCard objects from a JSON data stream (jCard format).
Example:
File file = new File("vcards.json");
JCardReader reader = null;
try {
reader = new JCardReader(file);
VCard vcard;
while ((vcard = reader.readNext()) != null) {
//...
}
} finally {
if (reader != null) reader.close();
}
context, index, warnings| Constructor and Description |
|---|
JCardReader(File file) |
JCardReader(InputStream in) |
JCardReader(JsonParser parser) |
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, setScribeIndexpublic JCardReader(String json)
json - the JSON string to read frompublic JCardReader(InputStream in)
in - the input stream to read frompublic JCardReader(File file) throws FileNotFoundException
file - the file to read fromFileNotFoundException - if the file doesn't existpublic JCardReader(Reader reader)
reader - the reader to read frompublic JCardReader(JsonParser parser)
parser - the parser to read fromprotected VCard _readNext() throws IOException
StreamReader_readNext in class StreamReaderIOException - if there's a problem reading from the streampublic void close() throws IOException
IOExceptionCopyright © 2012–2018 Michael Angstadt. All rights reserved.