public abstract class StreamReader extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
protected ScribeIndex |
index |
protected ParseWarnings |
warnings |
Constructor and Description |
---|
StreamReader() |
Modifier and Type | Method and Description |
---|---|
protected abstract VCard |
_readNext()
Reads the next vCard from the data stream.
|
protected void |
assignLabels(VCard vcard,
List<Label> labels)
|
ScribeIndex |
getScribeIndex()
Gets the scribe index.
|
List<String> |
getWarnings()
Gets the warnings from the last vCard that was unmarshalled.
|
List<VCard> |
readAll()
Reads all vCards from the data stream.
|
VCard |
readNext()
Reads the next vCard from the data stream.
|
void |
registerScribe(VCardPropertyScribe<? extends VCardProperty> scribe)
Registers a property scribe.
|
void |
setScribeIndex(ScribeIndex index)
Sets the scribe index.
|
protected final ParseWarnings warnings
protected ScribeIndex index
public List<VCard> readAll() throws IOException
IOException
- if there's a problem reading from the streampublic VCard readNext() throws IOException
IOException
- if there's a problem reading from the streamprotected abstract VCard _readNext() throws IOException
IOException
- if there's a problem reading from the streamprotected void assignLabels(VCard vcard, List<Label> labels)
Label
properties with their corresponding
Address
properties. If no match can be found, then the LABEL
property itself is assigned to the vCard.vcard
- the vCard that the properties belong tolabels
- the LABEL propertiespublic void registerScribe(VCardPropertyScribe<? extends VCardProperty> scribe)
Registers a property scribe. This is the same as calling:
getScribeIndex().register(scribe)
scribe
- the scribe to registerpublic ScribeIndex getScribeIndex()
public void setScribeIndex(ScribeIndex index)
index
- the scribe indexThis software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.