biweekly
Class Biweekly.WriterChainXml

java.lang.Object
  extended by biweekly.Biweekly.WriterChainXml
Enclosing class:
Biweekly

public static class Biweekly.WriterChainXml
extends Object

Chainer class for writing xCal documents (XML-encoded iCalendar objects).

See Also:
Biweekly.writeXml(Collection), Biweekly.writeXml(ICalendar...)

Method Summary
 Document dom()
          Writes the xCal document to an XML DOM.
 String go()
          Writes the xCal document to a string.
 void go(File file)
          Writes the xCal document to a file.
 void go(OutputStream out)
          Writes the xCal document to an output stream.
 void go(Writer writer)
          Writes the xCal document to a writer.
 Biweekly.WriterChainXml indent(int indent)
          Sets the number of indent spaces to use for pretty-printing.
 Biweekly.WriterChainXml register(ICalComponentMarshaller<? extends ICalComponent> marshaller)
          Registers a component marshaller.
 Biweekly.WriterChainXml register(ICalPropertyMarshaller<? extends ICalProperty> marshaller)
          Registers a property marshaller.
 Biweekly.WriterChainXml register(String parameterName, ICalDataType dataType)
          Registers the data type of an experimental parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

register

public Biweekly.WriterChainXml register(ICalPropertyMarshaller<? extends ICalProperty> marshaller)
Registers a property marshaller.

Parameters:
marshaller - the marshaller
Returns:
this

register

public Biweekly.WriterChainXml register(ICalComponentMarshaller<? extends ICalComponent> marshaller)
Registers a component marshaller.

Parameters:
marshaller - the marshaller
Returns:
this

register

public Biweekly.WriterChainXml register(String parameterName,
                                        ICalDataType dataType)
Registers the data type of an experimental parameter. Experimental parameters use the "unknown" xCal data type by default.

Parameters:
parameterName - the parameter name (e.g. "x-foo")
dataType - the data type
Returns:
this

indent

public Biweekly.WriterChainXml indent(int indent)
Sets the number of indent spaces to use for pretty-printing. If not set, then the XML will not be pretty-printed.

Parameters:
indent - the number of spaces
Returns:
this

go

public String go()
Writes the xCal document to a string.

Returns:
the XML string
Throws:
IllegalArgumentException - if the marshaller class for a component or property object cannot be found (only happens when an experimental property/component marshaller is not registered with the register method.)

go

public void go(OutputStream out)
        throws TransformerException
Writes the xCal document to an output stream.

Parameters:
out - the output stream to write to
Throws:
IllegalArgumentException - if the marshaller class for a component or property object cannot be found (only happens when an experimental property/component marshaller is not registered with the register method.)
TransformerException - if there's a problem writing the XML

go

public void go(File file)
        throws TransformerException,
               IOException
Writes the xCal document to a file.

Parameters:
file - the file to write to
Throws:
IllegalArgumentException - if the marshaller class for a component or property object cannot be found (only happens when an experimental property/component marshaller is not registered with the register method.)
TransformerException - if there's a problem writing the XML
IOException - if there's a problem writing to the file

go

public void go(Writer writer)
        throws TransformerException
Writes the xCal document to a writer.

Parameters:
writer - the writer to write to
Throws:
IllegalArgumentException - if the marshaller class for a component or property object cannot be found (only happens when an experimental property/component marshaller is not registered with the register method.)
TransformerException - if there's a problem writing the XML

dom

public Document dom()
Writes the xCal document to an XML DOM.

Returns:
the XML DOM


Copyright © 2013 Michael Angstadt. All Rights Reserved.