public class ChainingTextWriter extends Object
Biweekly.write(Collection)
,
Biweekly.write(ICalendar...)
Constructor and Description |
---|
ChainingTextWriter(Collection<ICalendar> icals) |
Modifier and Type | Method and Description |
---|---|
ChainingTextWriter |
caretEncoding(boolean enable)
Sets whether the writer will use circumflex accent encoding for parameter
values (disabled by default).
|
ChainingTextWriter |
foldLines(boolean foldLines)
Sets whether to fold long lines.
|
String |
go()
Writes the iCalendar objects to a string.
|
void |
go(File file)
Writes the iCalendar objects to a file.
|
void |
go(File file,
boolean append)
Writes the iCalendar objects to a file.
|
void |
go(OutputStream out)
Writes the iCalendar objects to an output stream.
|
void |
go(Writer writer)
Writes the iCalendar objects to a writer.
|
ChainingTextWriter |
register(ICalComponentScribe<? extends ICalComponent> scribe)
Registers a component scribe.
|
ChainingTextWriter |
register(ICalPropertyScribe<? extends ICalProperty> scribe)
Registers a property scribe.
|
ChainingTextWriter |
tz(TimeZone defaultTimeZone,
boolean outlookCompatible)
Sets the timezone to use when outputting date values (defaults to UTC).
|
ChainingTextWriter |
version(ICalVersion version)
Sets the version that all the iCalendar objects will be marshalled to.
|
public ChainingTextWriter(Collection<ICalendar> icals)
icals
- the iCalendar objects to writepublic ChainingTextWriter version(ICalVersion version)
Sets the version that all the iCalendar objects will be marshalled to.
The version that is attached to each individual ICalendar
object
will be ignored.
If no version is passed into this method, the writer will look at the
version attached to each individual ICalendar
object and marshal
it to that version. And if a ICalendar
object has no version
attached to it, then it will be marshalled to version 2.0.
version
- the version to marshal the iCalendar objects topublic ChainingTextWriter caretEncoding(boolean enable)
enable
- true to use circumflex accent encoding, false not toICalWriter.setCaretEncodingEnabled(boolean)
,
RFC 6868public ChainingTextWriter foldLines(boolean foldLines)
Sets whether to fold long lines. Line folding is when long lines are split up into multiple lines. No data is lost or changed when a line is folded.
Line folding is enabled by default. If the iCalendar consumer is not parsing your iCalendar objects properly, disabling line folding may help.
foldLines
- true to enable line folding, false to disable it
(defaults to true)public ChainingTextWriter tz(TimeZone defaultTimeZone, boolean outlookCompatible)
Sets the timezone to use when outputting date values (defaults to UTC).
This method downloads an appropriate VTIMEZONE component from the tzurl.org website.
defaultTimeZone
- the default timezone or null for UTCoutlookCompatible
- true to download a VTIMEZONE component that is
tailored for Microsoft Outlook email clients, false to download a
standards-based onepublic ChainingTextWriter register(ICalPropertyScribe<? extends ICalProperty> scribe)
scribe
- the scribe to registerpublic ChainingTextWriter register(ICalComponentScribe<? extends ICalComponent> scribe)
scribe
- the scribe to registerpublic void go(OutputStream out) throws IOException
out
- the output stream to write toIOException
- if there's a problem writing to the output streampublic void go(File file) throws IOException
file
- the file to write toIOException
- if there's a problem writing to the filepublic void go(File file, boolean append) throws IOException
file
- the file to write toappend
- true to append onto the end of the file, false to overwrite
itIOException
- if there's a problem writing to the filepublic void go(Writer writer) throws IOException
writer
- the writer to write toIOException
- if there's a problem writing to the writerCopyright © 2013–2024 Michael Angstadt. All rights reserved.