|
||||||||||
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. |
Charset |
getDefaultQuotedPrintableCharset()
Gets the character set to use when decoding quoted-printable values if the property has no CHARSET parameter, or if the CHARSET parameter is not a valid character set. |
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 |
setDefaultQuotedPrintableCharset(Charset charset)
Sets the character set to use when decoding quoted-printable values if the property has no CHARSET parameter, or if the CHARSET parameter is not a valid character set. |
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 frompublic 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 fromMethod Detail |
---|
public boolean isCaretDecodingEnabled()
VCardRawReader.isCaretDecodingEnabled()
public void setCaretDecodingEnabled(boolean enable)
enable
- true to use circumflex accent decoding, false not toVCardRawReader.setCaretDecodingEnabled(boolean)
public Charset getDefaultQuotedPrintableCharset()
Gets the character set to use when decoding quoted-printable values if the property has no CHARSET parameter, or if the CHARSET parameter is not a valid character set.
By default, the Reader's character encoding will be used. If the Reader has no character encoding, then the system's default character encoding will be used.
public void setDefaultQuotedPrintableCharset(Charset charset)
Sets the character set to use when decoding quoted-printable values if the property has no CHARSET parameter, or if the CHARSET parameter is not a valid character set.
By default, the Reader's character encoding will be used. If the Reader has no character encoding, then the system's default character encoding will be used.
charset
- the character setpublic 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 streampublic void close() throws IOException
Reader
object.
close
in interface Closeable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |