public class ICalRawWriter extends Object implements Closeable, Flushable
Constructor and Description |
---|
ICalRawWriter(Writer writer,
ICalVersion version) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying
Writer object. |
void |
flush()
Flushes the underlying
Writer object. |
FoldedLineWriter |
getFoldedLineWriter()
Gets the writer that this object wraps.
|
ICalVersion |
getVersion()
Gets the iCalendar version that the writer is adhering to.
|
boolean |
isCaretEncodingEnabled()
Gets whether the writer will apply circumflex accent encoding on
parameter values (disabled by default, only applies to version 2.0).
|
void |
setCaretEncodingEnabled(boolean enable)
Sets whether the writer will apply circumflex accent encoding on
parameter values (disabled by default, only applies to version 2.0).
|
void |
setVersion(ICalVersion version)
Sets the iCalendar version that the writer should adhere to.
|
void |
writeBeginComponent(String componentName)
Writes a property marking the beginning of a component.
|
void |
writeEndComponent(String componentName)
Writes a property marking the end of a component.
|
void |
writeProperty(String propertyName,
ICalParameters parameters,
String value)
Writes a property to the iCalendar data stream.
|
void |
writeProperty(String propertyName,
String value)
Writes a property to the iCalendar data stream.
|
void |
writeVersion()
Writes a "VERSION" property, setting its value to iCalendar version that
this writer is adhering to.
|
public ICalRawWriter(Writer writer, ICalVersion version)
writer
- the writer to wrapversion
- the version to adhere topublic FoldedLineWriter getFoldedLineWriter()
public boolean isCaretEncodingEnabled()
Gets whether the writer will apply circumflex accent encoding on parameter values (disabled by default, only applies to version 2.0). This escaping mechanism allows for newlines and double quotes to be included in parameter values.
Note that this encoding mechanism is defined separately from the iCalendar specification and may not be supported by the iCalendar consumer.
Raw Character | Encoded Character |
---|---|
" |
^' |
newline | ^n |
^ |
^^ |
Example:
GEO;X-ADDRESS="Pittsburgh Pirates^n115 Federal St^nPittsburgh, PA 15212":40.446816;80.00566
public void setCaretEncodingEnabled(boolean enable)
Sets whether the writer will apply circumflex accent encoding on parameter values (disabled by default, only applies to version 2.0). This escaping mechanism allows for newlines and double quotes to be included in parameter values.
Note that this encoding mechanism is defined separately from the iCalendar specification and may not be supported by the iCalendar consumer.
Raw Character | Encoded Character |
---|---|
" |
^' |
newline | ^n |
^ |
^^ |
Example:
GEO;X-ADDRESS="Pittsburgh Pirates^n115 Federal St^nPittsburgh, PA 15212":40.446816;80.00566
enable
- true to use circumflex accent encoding, false not topublic ICalVersion getVersion()
public void setVersion(ICalVersion version)
version
- the versionpublic void writeBeginComponent(String componentName) throws IOException
componentName
- the component name (e.g. "VEVENT")IOException
- if there's a problem writing to the data streampublic void writeEndComponent(String componentName) throws IOException
componentName
- the component name (e.g. "VEVENT")IOException
- if there's a problem writing to the data streampublic void writeVersion() throws IOException
IOException
- if there's a problem writing to the data streampublic void writeProperty(String propertyName, String value) throws IOException
propertyName
- the property name (e.g. "SUMMARY")value
- the property valueIllegalArgumentException
- if the property data contains one or
more characters which break the iCalendar syntax and which cannot be
escaped or encodedIOException
- if there's a problem writing to the data streampublic void writeProperty(String propertyName, ICalParameters parameters, String value) throws IOException
propertyName
- the property name (e.g. "SUMMARY")parameters
- the property parametersvalue
- the property valueIllegalArgumentException
- if the property data contains one or
more characters which break the iCalendar syntax and which cannot be
escaped or encodedIOException
- if there's a problem writing to the data streampublic void flush() throws IOException
Writer
object.flush
in interface Flushable
IOException
- if there's a problem flushing the writerpublic void close() throws IOException
Writer
object.close
in interface Closeable
close
in interface AutoCloseable
IOException
- if there's a problem closing the writerCopyright © 2013-2016 Michael Angstadt. All Rights Reserved.