public class XCardReader extends StreamReader
Reads xCards (XML-encoded vCards) in a streaming fashion.
Example:
File file = new File("vcards.xml");
List<VCard> vcards = new ArrayList<VCard>();
XCardReader xcardReader = new XCardReader(file);
VCard vcard;
while ((vcard = xcardReader.readNext()) != null) {
vcards.add(vcard);
}
xcardReader.close();
index, warnings| Constructor and Description |
|---|
XCardReader(File file)
Creates an xCard reader.
|
XCardReader(InputStream in)
Creates an xCard reader.
|
XCardReader(Node node)
Creates an xCard reader.
|
XCardReader(Reader reader)
Creates an xCard reader.
|
XCardReader(String xml)
Creates an xCard reader.
|
| 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 the xCards frompublic XCardReader(InputStream in)
in - the input stream to read the xCards frompublic XCardReader(File file) throws FileNotFoundException
file - the file to read the xCards 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
IOExceptionThis software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.