public class VCardReader extends StreamReader
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();
index, warnings
Constructor and Description |
---|
VCardReader(java.io.File file)
Creates a vCard reader.
|
VCardReader(java.io.InputStream in)
Creates a vCard reader.
|
VCardReader(java.io.Reader reader)
Creates a vCard reader.
|
VCardReader(java.lang.String str)
Creates a vCard reader.
|
Modifier and Type | Method and Description |
---|---|
protected VCard |
_readNext()
Reads the next vCard from the data stream.
|
void |
close()
Closes the underlying
Reader object. |
java.nio.charset.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.
|
boolean |
isCaretDecodingEnabled()
Gets whether the reader will decode parameter values that use circumflex
accent encoding (enabled by default).
|
void |
setCaretDecodingEnabled(boolean enable)
Sets whether the reader will decode parameter values that use circumflex
accent encoding (enabled by default).
|
void |
setDefaultQuotedPrintableCharset(java.nio.charset.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.
|
assignLabels, getScribeIndex, getWarnings, readAll, readNext, registerScribe, setScribeIndex
public VCardReader(java.lang.String str)
str
- the string to read the vCards frompublic VCardReader(java.io.InputStream in)
in
- the input stream to read the vCards frompublic VCardReader(java.io.File file) throws java.io.FileNotFoundException
file
- the file to read the vCards fromjava.io.FileNotFoundException
- if the file doesn't existpublic VCardReader(java.io.Reader reader)
reader
- the reader to read the vCards frompublic boolean isCaretDecodingEnabled()
VCardRawReader.isCaretDecodingEnabled()
public void setCaretDecodingEnabled(boolean enable)
enable
- true to use circumflex accent decoding, false not toVCardRawReader.setCaretDecodingEnabled(boolean)
public java.nio.charset.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(java.nio.charset.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 setprotected VCard _readNext() throws java.io.IOException
StreamReader
_readNext
in class StreamReader
java.io.IOException
- if there's a problem reading from the streampublic void close() throws java.io.IOException
Reader
object.java.io.IOException
This software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.