public class VCardReader extends StreamReader
Parses VCard objects from a plain-text vCard data stream.
Example:
Path file = Paths.get("vcards.vcf");
try (VCardReader reader = new VCardReader(file)) {
VCard vcard;
while ((vcard = reader.readNext()) != null) {
//...
}
}
context, index, warnings| Constructor and Description |
|---|
VCardReader(InputStream in)
Creates a new vCard reader.
|
VCardReader(InputStream in,
VCardVersion defaultVersion)
Creates a new vCard reader.
|
VCardReader(Path file)
Creates a new vCard reader.
|
VCardReader(Path file,
VCardVersion defaultVersion)
Creates a new vCard reader.
|
VCardReader(Reader reader)
Creates a new vCard reader.
|
VCardReader(Reader reader,
VCardVersion defaultVersion)
Creates a new vCard reader.
|
VCardReader(String str)
Creates a new vCard reader.
|
VCardReader(String str,
VCardVersion defaultVersion)
Creates a new vCard reader.
|
| Modifier and Type | Method and Description |
|---|---|
protected VCard |
_readNext()
Reads the next vCard from the data stream.
|
void |
close()
Closes the input stream.
|
Charset |
getDefaultQuotedPrintableCharset()
Gets the character set to use when the parser cannot determine what
character set to use to decode a quoted-printable property value.
|
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(Charset charset)
Sets the character set to use when the parser cannot determine what
character set to use to decode a quoted-printable property value.
|
assignLabels, getScribeIndex, getWarnings, readAll, readNext, registerScribe, setScribeIndexpublic VCardReader(String str)
str - the string to read frompublic VCardReader(String str, VCardVersion defaultVersion)
str - the string to read fromdefaultVersion - the version to assume the vCard is in until a
VERSION property is encountered (defaults to 2.1)public VCardReader(InputStream in)
in - the input stream to read frompublic VCardReader(InputStream in, VCardVersion defaultVersion)
in - the input stream to read fromdefaultVersion - the version to assume the vCard is in until a
VERSION property is encountered (defaults to 2.1)public VCardReader(Path file) throws IOException
file - the file to read fromIOException - if there is a problem opening the filepublic VCardReader(Path file, VCardVersion defaultVersion) throws IOException
file - the file to read fromdefaultVersion - the version to assume the vCard is in until a
VERSION property is encountered (defaults to 2.1)IOException - if there is a problem opening the filepublic VCardReader(Reader reader)
reader - the reader to read frompublic VCardReader(Reader reader, VCardVersion defaultVersion)
reader - the reader to read fromdefaultVersion - the version to assume the vCard is in until a
VERSION property is encountered (defaults to 2.1)public boolean isCaretDecodingEnabled()
VObjectReader.isCaretDecodingEnabled()public void setCaretDecodingEnabled(boolean enable)
enable - true to use circumflex accent decoding, false not toVObjectReader.setCaretDecodingEnabled(boolean)public Charset getDefaultQuotedPrintableCharset()
VObjectReader.getDefaultQuotedPrintableCharset()public void setDefaultQuotedPrintableCharset(Charset charset)
charset - the character set (cannot be null)VObjectReader.setDefaultQuotedPrintableCharset(java.nio.charset.Charset)protected VCard _readNext() throws IOException
StreamReader_readNext in class StreamReaderIOException - if there's a problem reading from the streampublic void close() throws IOException
IOException - if there's a problem closing the input streamCopyright © 2012–2023 Michael Angstadt. All rights reserved.