public class XCardReader extends StreamReader
Reads xCards (XML-encoded vCards) in a streaming fashion.
Example:
Path file = Paths.get("vcards.xml"); try (XCardReader reader = new XCardReader(file)) { VCard vcard; while ((vcard = reader.readNext()) != null) { //... } }
context, index, warnings
Constructor and Description |
---|
XCardReader(InputStream in) |
XCardReader(Node node) |
XCardReader(Path file) |
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, setScribeIndex
public XCardReader(String xml)
xml
- the XML to read frompublic XCardReader(InputStream in)
in
- the input stream to read frompublic XCardReader(Path file) throws IOException
file
- the file to read fromIOException
- if there is a problem opening the filepublic 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 StreamReader
IOException
- if there's a problem reading from the streampublic void close() throws IOException
IOException
Copyright © 2012–2023 Michael Angstadt. All rights reserved.