public class ChainingXmlWriter extends Object
Biweekly.writeXml(Collection)
,
Biweekly.writeXml(ICalendar...)
Constructor and Description |
---|
ChainingXmlWriter(Collection<ICalendar> icals) |
Modifier and Type | Method and Description |
---|---|
Document |
dom()
Generates an XML document object model (DOM) containing the iCalendar
objects.
|
String |
go()
Writes the iCalendar objects to a string.
|
void |
go(File file)
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.
|
ChainingXmlWriter |
indent(Integer indent)
Sets the number of indent spaces to use for pretty-printing.
|
ChainingXmlWriter |
outputProperties(Map<String,String> outputProperties)
Assigns all of the given output properties to the JAXP transformer (see
Transformer.setOutputProperty(java.lang.String, java.lang.String) ). |
ChainingXmlWriter |
outputProperty(String name,
String value)
Assigns an output property to the JAXP transformer (see
Transformer.setOutputProperty(java.lang.String, java.lang.String) ). |
ChainingXmlWriter |
register(ICalComponentScribe<? extends ICalComponent> scribe)
Registers a component scribe.
|
ChainingXmlWriter |
register(ICalPropertyScribe<? extends ICalProperty> scribe)
Registers a property scribe.
|
ChainingXmlWriter |
register(String parameterName,
ICalDataType dataType)
Registers the data type of a non-standard parameter.
|
ChainingXmlWriter |
tz(TimeZone defaultTimeZone,
boolean outlookCompatible)
Sets the timezone to use when outputting date values (defaults to UTC).
|
ChainingXmlWriter |
xmlVersion(String xmlVersion)
Sets the XML version to use.
|
public ChainingXmlWriter(Collection<ICalendar> icals)
icals
- the iCValendar objects to writepublic ChainingXmlWriter indent(Integer indent)
indent
- the number of spaces in the indent string or "null" not to
pretty-print (disabled by default)public ChainingXmlWriter xmlVersion(String xmlVersion)
xmlVersion
- the XML version (defaults to "1.0")public ChainingXmlWriter outputProperty(String name, String value)
Transformer.setOutputProperty(java.lang.String, java.lang.String)
).name
- the property namevalue
- the property valuepublic ChainingXmlWriter outputProperties(Map<String,String> outputProperties)
Transformer.setOutputProperty(java.lang.String, java.lang.String)
).outputProperties
- the propertiespublic ChainingXmlWriter 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 ChainingXmlWriter register(ICalPropertyScribe<? extends ICalProperty> scribe)
scribe
- the scribe to registerpublic ChainingXmlWriter register(ICalComponentScribe<? extends ICalComponent> scribe)
scribe
- the scribe to registerpublic ChainingXmlWriter register(String parameterName, ICalDataType dataType)
parameterName
- the parameter name (e.g. "x-foo")dataType
- the data typepublic void go(OutputStream out) throws TransformerException
out
- the output stream to write toTransformerException
- if there's a problem writing to the output
streampublic void go(File file) throws IOException, TransformerException
file
- the file to write toIOException
- if the file can't be openedTransformerException
- if there's a problem writing to the filepublic void go(Writer writer) throws TransformerException
writer
- the writer to write toTransformerException
- if there's a problem writing to the writerCopyright © 2013–2024 Michael Angstadt. All rights reserved.