public class XCardReader extends StreamReader
Reads xCards (XML-encoded vCards) in a streaming fashion.
Example:
File file = new File("vcards.xml");
XCardReader reader = null;
try {
reader = new XCardReader(file);
VCard vcard;
while ((vcard = reader.readNext()) != null) {
//...
}
} finally {
if (reader != null) reader.close();
}
context, index, warnings| Constructor and Description |
|---|
XCardReader(File file) |
XCardReader(InputStream in) |
XCardReader(Node node) |
XCardReader(Reader reader) |
XCardReader(String xml) |
| Modifier and Type | Method and Description |
|---|---|
protected VCard |
_readNext()
Reads the next vCard from the data stream.
|
void |
close()
Closes the underlying input stream.
|
assignLabels, getScribeIndex, getWarnings, readAll, readNext, registerScribe, setScribeIndexpublic XCardReader(String xml)
xml - the XML to read frompublic XCardReader(InputStream in)
in - the input stream to read frompublic XCardReader(File file) throws FileNotFoundException
file - the file to read fromFileNotFoundException - if the file doesn't existpublic XCardReader(Reader reader)
reader - the reader to read frompublic XCardReader(Node node)
node - the DOM node 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.