public abstract class StreamReader extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
protected ParseContext |
context |
protected ScribeIndex |
index |
protected List<ParseWarning> |
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<ParseWarning> |
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 List<ParseWarning> warnings
protected ScribeIndex index
protected ParseContext context
public StreamReader()
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 indexpublic List<ParseWarning> getWarnings()
Copyright © 2012–2023 Michael Angstadt. All rights reserved.