|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectezvcard.io.VCardWriter
public class VCardWriter
Writes VCard
objects to a plain-text vCard data stream.
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 apply circumflex accent encoding on parameter values (disabled by default, only applies to 3.0 and 4.0 vCards). |
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 apply circumflex accent encoding on parameter values (disabled by default, only applies to 3.0 and 4.0 vCards). |
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 to the stream. |
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 apply circumflex accent encoding on parameter values (disabled by default, only applies to 3.0 and 4.0 vCards). This escaping mechanism allows for newlines and double quotes to be included in parameter values.
When disabled, the writer will replace newlines with spaces and double quotes with single quotes.
VCardRawWriter.isCaretEncodingEnabled()
public void setCaretEncodingEnabled(boolean enable)
Sets whether the writer will apply circumflex accent encoding on parameter values (disabled by default, only applies to 3.0 and 4.0 vCards). This escaping mechanism allows for newlines and double quotes to be included in parameter values.
When disabled, the writer will replace newlines with spaces and double quotes with single quotes.
enable
- true to use circumflex accent encoding, false not toVCardRawWriter.setCaretEncodingEnabled(boolean)
public 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 |