public class VCardRawReader extends Object implements Closeable
Constructor and Description |
---|
VCardRawReader(Reader reader)
Creates a new reader.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying
Reader object. |
Charset |
getEncoding()
Gets the character encoding of the reader.
|
int |
getLineNum()
Gets the line number of the last line that was read.
|
VCardVersion |
getVersion()
Gets the vCard version that the reader is currently parsing with.
|
boolean |
isCaretDecodingEnabled()
Gets whether the reader will decode parameter values that use circumflex
accent encoding (enabled by default).
|
VCardRawLine |
readLine()
Parses the next line of the vCard file.
|
void |
setCaretDecodingEnabled(boolean enable)
Sets whether the reader will decode parameter values that use circumflex
accent encoding (enabled by default).
|
public VCardRawReader(Reader reader)
reader
- the reader to the data streampublic int getLineNum()
public VCardVersion getVersion()
public VCardRawLine readLine() throws IOException
InvalidVersionException
- if a VERSION property with an invalid
value is encounteredVCardParseException
- if a line cannot be parsedIOException
- if there's a problem reading from the input streampublic boolean isCaretDecodingEnabled()
Gets whether the reader will decode parameter values that use circumflex accent encoding (enabled by default). This escaping mechanism allows newlines and double quotes to be included in parameter values.
Raw Character | Encoded Character |
---|---|
" |
^' |
newline | ^n |
^ |
^^ |
Example:
GEO;X-ADDRESS="Pittsburgh Pirates^n115 Federal St^nPitt sburgh, PA 15212":40.446816;80.00566
public void setCaretDecodingEnabled(boolean enable)
Sets whether the reader will decode parameter values that use circumflex accent encoding (enabled by default). This escaping mechanism allows newlines and double quotes to be included in parameter values.
Raw Character | Encoded Character |
---|---|
" |
^' |
newline | ^n |
^ |
^^ |
Example:
GEO;X-ADDRESS="Pittsburgh Pirates^n115 Federal St^nPitt sburgh, PA 15212":geo:40.446816,-80.00566
enable
- true to use circumflex accent decoding, false not topublic Charset getEncoding()
public void close() throws IOException
Reader
object.close
in interface Closeable
close
in interface AutoCloseable
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.