|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectezvcard.io.json.JCardRawWriter
public class JCardRawWriter
Writes data to an vCard JSON data stream (jCard).
| Constructor Summary | |
|---|---|
JCardRawWriter(Writer writer,
boolean wrapInArray)
Creates a new raw writer. |
|
| Method Summary | |
|---|---|
void |
close()
Finishes writing the JSON document and closes the underlying Writer. |
void |
closeJsonStream()
Finishes writing the JSON document so that it is syntactically correct. |
void |
flush()
Flushes the JSON stream. |
boolean |
isIndent()
Gets whether or not the JSON will be pretty-printed. |
void |
setIndent(boolean indent)
Sets whether or not to pretty-print the JSON. |
void |
writeEndVCard()
Closes the "vcard" component array. |
void |
writeProperty(String group,
String propertyName,
VCardParameters parameters,
VCardDataType dataType,
JCardValue value)
Writes a property to the current vCard. |
void |
writeProperty(String propertyName,
VCardDataType dataType,
JCardValue value)
Writes a property to the current component. |
void |
writeStartVCard()
Writes the beginning of a new "vcard" component. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JCardRawWriter(Writer writer,
boolean wrapInArray)
writer - the writer to the data streamwrapInArray - true to wrap everything in an array, false not to
(useful when writing more than one vCard)| Method Detail |
|---|
public boolean isIndent()
public void setIndent(boolean indent)
indent - true to pretty-print it, false not to (defaults to false)
public void writeStartVCard()
throws IOException
IOException - if there's an I/O problem
public void writeEndVCard()
throws IOException
IllegalStateException - if the component was never opened (
writeStartVCard() must be called first)
IOException - if there's an I/O problem
public void writeProperty(String propertyName,
VCardDataType dataType,
JCardValue value)
throws IOException
propertyName - the property name (e.g. "version")dataType - the data type or null for "unknown"value - the property value
IllegalStateException - if the "vcard" component was never opened
or was just closed (writeStartVCard() must be called first)
IOException - if there's an I/O problem
public void writeProperty(String group,
String propertyName,
VCardParameters parameters,
VCardDataType dataType,
JCardValue value)
throws IOException
group - the group or null if there is no grouppropertyName - the property name (e.g. "version")parameters - the parametersdataType - the data type or null for "unknown"value - the property value
IllegalStateException - if the "vcard" component was never opened
or was just closed (writeStartVCard() must be called first)
IOException - if there's an I/O problem
public void flush()
throws IOException
flush in interface FlushableIOException
public void closeJsonStream()
throws IOException
IOException - if there's a problem closing the stream
public void close()
throws IOException
Writer.
close in interface CloseableIOException - if there's a problem closing the stream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||