public class ICalRawWriter extends Object implements Closeable, Flushable
| Modifier and Type | Class and Description |
|---|---|
static interface |
ICalRawWriter.ParameterValueChangedListener
Allows you to respond to when a parameter's value is changed due to it
containing invalid characters.
|
| Constructor and Description |
|---|
ICalRawWriter(Writer writer)
Creates an iCalendar raw writer using the standard folding scheme and
newline sequence.
|
ICalRawWriter(Writer writer,
FoldingScheme foldingScheme)
Creates an iCalendar raw writer using the standard newline sequence.
|
ICalRawWriter(Writer writer,
FoldingScheme foldingScheme,
String newline)
Creates an iCalendar raw writer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the underlying
Writer object. |
void |
flush()
Flushes the underlying
Writer object. |
FoldingScheme |
getFoldingScheme()
Gets the rules for how each line is folded.
|
String |
getNewline()
Gets the newline sequence that is used to separate lines.
|
ICalRawWriter.ParameterValueChangedListener |
getParameterValueChangedListener()
Gets the listener which will be invoked when a parameter's value is
changed due to containing invalid characters.
|
boolean |
isCaretEncodingEnabled()
Gets whether the writer will apply circumflex accent encoding on
parameter values (disabled by default).
|
void |
setCaretEncodingEnabled(boolean enable)
Sets whether the writer will apply circumflex accent encoding on
parameter values (disabled by default).
|
void |
setParameterValueChangedListener(ICalRawWriter.ParameterValueChangedListener parameterValueChangedListener)
Sets the listener which will be invoked when a parameter's value is
changed due to containing invalid characters.
|
void |
writeBeginComponent(String componentName)
Writes a property marking the beginning of a component (in other words,
writes a "BEGIN:NAME" property).
|
void |
writeEndComponent(String componentName)
Writes a property marking the end of a component (in other words, writes
a "END:NAME" property).
|
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.
|
public ICalRawWriter(Writer writer)
writer - the writer to the data streampublic ICalRawWriter(Writer writer, FoldingScheme foldingScheme)
writer - the writer to the data streamfoldingScheme - the folding scheme to use or null not to fold at allpublic ICalRawWriter(Writer writer, FoldingScheme foldingScheme, String newline)
writer - the writer to the data streamfoldingScheme - the folding scheme to use or null not to fold at allnewline - the newline sequence to usepublic boolean isCaretEncodingEnabled()
Gets whether the writer will apply circumflex accent encoding on parameter values (disabled by default). 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.
| Character | Replacement (when disabled) |
Replacement (when enabled) |
|---|---|---|
" |
' |
^' |
| newline | space |
^n |
^ |
^ |
^^ |
Example:
GEO;X-ADDRESS="Pittsburgh Pirates^n115 Federal St^nPitt sburgh, 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). 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.
| Character | Replacement (when disabled) |
Replacement (when enabled) |
|---|---|---|
" |
' |
^' |
| newline | space |
^n |
^ |
^ |
^^ |
Example:
GEO;X-ADDRESS="Pittsburgh Pirates^n115 Federal St^nPitt sburgh, PA 15212":40.446816;80.00566
enable - true to use circumflex accent encoding, false not topublic String getNewline()
public ICalRawWriter.ParameterValueChangedListener getParameterValueChangedListener()
public void setParameterValueChangedListener(ICalRawWriter.ParameterValueChangedListener parameterValueChangedListener)
parameterValueChangedListener - the listener or null to removepublic FoldingScheme getFoldingScheme()
public void writeBeginComponent(String componentName) throws IOException
componentName - the component name (e.g. "VEVENT")IOException - if there's an I/O problempublic void writeEndComponent(String componentName) throws IOException
componentName - the component name (e.g. "VEVENT")IOException - if there's an I/O problempublic void writeProperty(String propertyName, String value) throws IOException
propertyName - the property name (e.g. "VERSION")value - the property value (e.g. "2.0")IllegalArgumentException - if the property name contains invalid
charactersIOException - if there's an I/O problempublic void writeProperty(String propertyName, ICalParameters parameters, String value) throws IOException
propertyName - the property name (e.g. "VERSION")parameters - the property parametersvalue - the property value (e.g. "2.0")IllegalArgumentException - if the property name contains invalid
charactersIOException - if there's an I/O problempublic void flush() throws IOException
Writer object.flush in interface FlushableIOException - if there's a problem flushing the writerpublic void close() throws IOException
Writer object.close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2013-2014 Michael Angstadt. All Rights Reserved.