public abstract class StreamWriter extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
protected WriteContext |
context |
protected ScribeIndex |
index |
protected TimezoneInfo |
tzinfo |
Constructor and Description |
---|
StreamWriter() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
_write(ICalendar ical)
Writes an iCalendar object to the data stream.
|
ScribeIndex |
getScribeIndex()
Gets the object that manages the component/property scribes.
|
protected abstract ICalVersion |
getTargetVersion()
Gets the version that the next iCalendar object will be written as.
|
TimezoneInfo |
getTimezoneInfo()
Gets the timezone-related info for this writer.
|
void |
registerScribe(ICalComponentScribe<? extends ICalComponent> scribe)
Registers an experimental component scribe.
|
void |
registerScribe(ICalPropertyScribe<? extends ICalProperty> scribe)
Registers an experimental property scribe.
|
void |
setScribeIndex(ScribeIndex scribe)
Sets the object that manages the component/property scribes.
|
void |
setTimezoneInfo(TimezoneInfo tzinfo)
Sets the timezone-related info for this writer.
|
void |
write(ICalendar ical)
Writes an iCalendar object to the data stream.
|
protected ScribeIndex index
protected WriteContext context
protected TimezoneInfo tzinfo
public StreamWriter()
public void write(ICalendar ical) throws IOException
ical
- the iCalendar object to writeIllegalArgumentException
- if the scribe class for a component or
property object cannot be found (only happens when an experimental
property/component scribe is not registered with the
registerScribe
method.)IOException
- if there's a problem writing to the data streamprotected abstract ICalVersion getTargetVersion()
protected abstract void _write(ICalendar ical) throws IOException
ical
- the iCalendar object to writeIOException
- if there's a problem writing to the data streampublic TimezoneInfo getTimezoneInfo()
public void setTimezoneInfo(TimezoneInfo tzinfo)
tzinfo
- the timezone-related infopublic void registerScribe(ICalPropertyScribe<? extends ICalProperty> scribe)
Registers an experimental property scribe. Can also be used to override the scribe of a standard property (such as DTSTART). Calling this method is the same as calling:
getScribeIndex().register(scribe)
.
scribe
- the scribe to registerpublic void registerScribe(ICalComponentScribe<? extends ICalComponent> scribe)
Registers an experimental component scribe. Can also be used to override the scribe of a standard component (such as VEVENT). Calling this method is the same as calling:
getScribeIndex().register(scribe)
.
scribe
- the scribe to registerpublic ScribeIndex getScribeIndex()
public void setScribeIndex(ScribeIndex scribe)
scribe
- the scribe indexCopyright © 2013-2015 Michael Angstadt. All Rights Reserved.