|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiweekly.io.text.ICalRawWriter
public class ICalRawWriter
Writes data to an iCalendar data stream.
Nested Class Summary | |
---|---|
static interface |
ICalRawWriter.ParameterValueChangedListener
Allows you to respond to when a parameter's value is changed due to it containing invalid characters. |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
void |
close()
Closes 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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 useMethod Detail |
---|
public 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
characters
IOException
- 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
characters
IOException
- if there's an I/O problempublic 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 |