biweekly
Class Biweekly.WriterChainJson

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

public static class Biweekly.WriterChainJson
extends Object

Chainer class for writing to JSON-encoded iCalendar data streams (jCal).

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

Method Summary
 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 a data stream.
 void go(Writer writer)
          Writes the iCalendar objects to a data stream.
 Biweekly.WriterChainJson indent(boolean indent)
          Sets whether or not to pretty-print the JSON.
 T register(ICalComponentMarshaller<? extends ICalComponent> marshaller)
          Registers a component marshaller.
 T register(ICalPropertyMarshaller<? extends ICalProperty> marshaller)
          Registers a property marshaller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

indent

public Biweekly.WriterChainJson indent(boolean indent)
Sets whether or not to pretty-print the JSON.

Parameters:
indent - true to pretty-print it, false not to (defaults to false)
Returns:
this

go

public String go()
Writes the iCalendar objects to a string.

Returns:
the iCalendar 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 IOException
Writes the iCalendar objects to a data 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.)
IOException - if there's a problem writing to the output stream

go

public void go(File file)
        throws IOException
Writes the iCalendar objects 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.)
IOException - if there's a problem writing to the file

go

public void go(Writer writer)
        throws IOException
Writes the iCalendar objects to a data stream.

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.)
IOException - if there's a problem writing to the writer

register

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

Parameters:
marshaller - the marshaller
Returns:
this

register

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

Parameters:
marshaller - the marshaller
Returns:
this


Copyright © 2013 Michael Angstadt. All Rights Reserved.