|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectezvcard.io.VCardWriter
public class VCardWriter
Converts vCards to string representations.
Constructor Summary | |
---|---|
VCardWriter(File file)
Creates a vCard writer (writes v3.0 vCards and uses the standard folding scheme and newline sequence). |
|
VCardWriter(File file,
VCardVersion targetVersion)
Creates a vCard writer (uses the standard folding scheme and newline sequence). |
|
VCardWriter(File file,
VCardVersion targetVersion,
FoldingScheme foldingScheme,
String newline)
Creates a vCard writer. |
|
VCardWriter(OutputStream out)
Creates a vCard writer (writes v3.0 vCards and uses the standard folding scheme and newline sequence). |
|
VCardWriter(OutputStream out,
VCardVersion targetVersion)
Creates a vCard writer (uses the standard folding scheme and newline sequence). |
|
VCardWriter(OutputStream out,
VCardVersion targetVersion,
FoldingScheme foldingScheme,
String newline)
Creates a vCard writer. |
|
VCardWriter(Writer writer)
Creates a vCard writer (writes v3.0 vCards and uses the standard folding scheme and newline sequence). |
|
VCardWriter(Writer writer,
VCardVersion targetVersion)
Creates a vCard writer (uses the standard folding scheme and newline sequence). |
|
VCardWriter(Writer writer,
VCardVersion targetVersion,
FoldingScheme foldingScheme,
String newline)
Creates a vCard writer. |
Method Summary | |
---|---|
void |
close()
Closes the underlying Writer object. |
CompatibilityMode |
getCompatibilityMode()
Deprecated. |
FoldingScheme |
getFoldingScheme()
Gets the rules for how each line is folded. |
String |
getNewline()
Gets the newline sequence that is used to separate lines. |
VCardVersion |
getTargetVersion()
Gets the version that the vCards should adhere to. |
List<String> |
getWarnings()
Gets the warnings from the last vCard that was marshalled. |
boolean |
isAddProdId()
Gets whether or not a "PRODID" type will be added to each vCard, saying that the vCard was generated by this library. |
boolean |
isCaretEncodingEnabled()
Gets whether the writer will use circumflex accent encoding for vCard 3.0 and 4.0 parameter values. |
void |
setAddProdId(boolean addProdId)
Sets whether or not to add a "PRODID" type to each vCard, saying that the vCard was generated by this library. |
void |
setCaretEncodingEnabled(boolean enable)
Sets whether the writer will use circumflex accent encoding for vCard 3.0 and 4.0 parameter values. |
void |
setCompatibilityMode(CompatibilityMode compatibilityMode)
Deprecated. |
void |
setTargetVersion(VCardVersion targetVersion)
Sets the version that the vCards should adhere to. |
void |
write(VCard vcard)
Writes a vCard |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VCardWriter(OutputStream out)
out
- the output stream to write the vCard topublic VCardWriter(OutputStream out, VCardVersion targetVersion)
out
- the output stream to write the vCard totargetVersion
- the version that the vCards should conform topublic VCardWriter(OutputStream out, VCardVersion targetVersion, FoldingScheme foldingScheme, String newline)
out
- the output stream to write the vCard totargetVersion
- the version that the vCards should conform tofoldingScheme
- the folding scheme to use or null not to fold at allnewline
- the newline sequence to usepublic VCardWriter(File file) throws IOException
file
- the file to write the vCard to
IOException
- if there's a problem opening the filepublic VCardWriter(File file, VCardVersion targetVersion) throws IOException
file
- the file to write the vCard totargetVersion
- the version that the vCards should conform to
IOException
- if there's a problem opening the filepublic VCardWriter(File file, VCardVersion targetVersion, FoldingScheme foldingScheme, String newline) throws IOException
file
- the file to write the vCard totargetVersion
- the version that the vCards should conform tofoldingScheme
- the folding scheme to use or null not to fold at allnewline
- the newline sequence to use
IOException
- if there's a problem opening the filepublic VCardWriter(Writer writer)
writer
- the writer to write the vCard topublic VCardWriter(Writer writer, VCardVersion targetVersion)
writer
- the writer to write the vCard totargetVersion
- the version that the vCards should conform topublic VCardWriter(Writer writer, VCardVersion targetVersion, FoldingScheme foldingScheme, String newline)
writer
- the writer to write the vCard totargetVersion
- the version that the vCards should conform tofoldingScheme
- the folding scheme to use or null not to fold at allnewline
- the newline sequence to useMethod Detail |
---|
@Deprecated public CompatibilityMode getCompatibilityMode()
@Deprecated public void setCompatibilityMode(CompatibilityMode compatibilityMode)
compatibilityMode
- the compatibility modepublic VCardVersion getTargetVersion()
public void setTargetVersion(VCardVersion targetVersion)
targetVersion
- the vCard versionpublic boolean isAddProdId()
public void setAddProdId(boolean addProdId)
addProdId
- true to add this type, false not to (defaults to true)public boolean isCaretEncodingEnabled()
Gets whether the writer will use circumflex accent encoding for vCard 3.0 and 4.0 parameter values. This escaping mechanism allows for newlines and double quotes to be included in parameter values.
Character | Replacement |
---|---|
" |
^' |
newline | ^n |
^ |
^^ |
This setting is disabled by default and is only used with 3.0 and 4.0 vCards. When writing a vCard with this setting disabled, newlines will be escaped as "\n", backslashes will be escaped as "\\", and double quotes will be replaced with single quotes.
Example:
GEO;X-ADDRESS="Pittsburgh Pirates^n115 Federal St^nPitt sburgh, PA 15212":geo:40.446816,-80.00566
public void setCaretEncodingEnabled(boolean enable)
Sets whether the writer will use circumflex accent encoding for vCard 3.0 and 4.0 parameter values. This escaping mechanism allows for newlines and double quotes to be included in parameter values.
Character | Replacement |
---|---|
" |
^' |
newline | ^n |
^ |
^^ |
This setting is disabled by default and is only used with 3.0 and 4.0 vCards. When writing a vCard with this setting disabled, newlines will be escaped as "\n", backslashes will be escaped as "\\", and double quotes will be replaced with single quotes.
Example:
GEO;X-ADDRESS="Pittsburgh Pirates^n115 Federal St^nPitt sburgh, PA 15212":geo:40.446816,-80.00566
enable
- true to use circumflex accent encoding, false not topublic String getNewline()
public FoldingScheme getFoldingScheme()
public List<String> getWarnings()
public void write(VCard vcard) throws IOException
vcard
- the vCard to write
IOException
- if there's a problem writing to the output streampublic void close() throws IOException
Writer
object.
close
in interface Closeable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |