|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectezvcard.io.text.VCardReader
public class VCardReader
Parses VCard objects from a plain-text vCard data stream.
Example:
File file = new File("vcards.vcf");
VCardReader vcardReader = new VCardReader(file);
VCard vcard;
while ((vcard = vcardReader.readNext()) != null){
...
}
vcardReader.close();
| Constructor Summary | |
|---|---|
VCardReader(File file)
Creates a reader that parses vCards from a file. |
|
VCardReader(InputStream in)
Creates a reader that parses vCards from an input stream. |
|
VCardReader(Reader reader)
Creates a reader that parses vCards from a reader. |
|
VCardReader(String str)
Creates a reader that parses vCards from a string. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the underlying Reader object. |
ScribeIndex |
getScribeIndex()
Gets the scribe index. |
List<String> |
getWarnings()
Gets the warnings from the last vCard that was unmarshalled. |
boolean |
isCaretDecodingEnabled()
Gets whether the reader will decode parameter values that use circumflex accent encoding (enabled by default). |
VCard |
readNext()
Reads the next vCard from the data stream. |
void |
registerScribe(VCardPropertyScribe<? extends VCardProperty> scribe)
Registers a property scribe. |
void |
setCaretDecodingEnabled(boolean enable)
Sets whether the reader will decode parameter values that use circumflex accent encoding (enabled by default). |
void |
setScribeIndex(ScribeIndex index)
Sets the scribe index. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VCardReader(String str)
str - the string to read the vCards frompublic VCardReader(InputStream in)
in - the input stream to read the vCards from
public VCardReader(File file)
throws FileNotFoundException
file - the file to read the vCards from
FileNotFoundException - if the file doesn't existpublic VCardReader(Reader reader)
reader - the reader to read the vCards from| Method Detail |
|---|
public boolean isCaretDecodingEnabled()
VCardRawReader.isCaretDecodingEnabled()public void setCaretDecodingEnabled(boolean enable)
enable - true to use circumflex accent decoding, false not toVCardRawReader.setCaretDecodingEnabled(boolean)public 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<String> getWarnings()
public VCard readNext()
throws IOException
IOException - if there's a problem reading from the stream
public void close()
throws IOException
Reader object.
close in interface CloseableIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||