biweekly
Class Biweekly.ParserChainJsonReader

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

public static class Biweekly.ParserChainJsonReader
extends Object

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

See Also:
Biweekly.parseJson(InputStream), Biweekly.parseJson(File), Biweekly.parseJson(Reader)

Method Summary
 List<ICalendar> all()
          Reads all iCalendar objects from the data stream.
 ICalendar first()
          Reads the first iCalendar object from the data stream.
 Biweekly.ParserChainJsonReader register(ICalComponentMarshaller<? extends ICalComponent> marshaller)
          Registers a component marshaller.
 Biweekly.ParserChainJsonReader register(ICalPropertyMarshaller<? extends ICalProperty> marshaller)
          Registers a property marshaller.
 Biweekly.ParserChainJsonReader warnings(List<List<String>> warnings)
          Provides a list for putting the parser warnings into.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

register

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

Parameters:
marshaller - the marshaller
Returns:
this

register

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

Parameters:
marshaller - the marshaller
Returns:
this

warnings

public Biweekly.ParserChainJsonReader warnings(List<List<String>> warnings)
Provides a list for putting the parser warnings into.

Parameters:
warnings - the list object to populate (it is a "list of lists"--each parsed ICalendar object has its own warnings list)
Returns:
this

first

public ICalendar first()
                throws IOException
Reads the first iCalendar object from the data stream.

Returns:
the first iCalendar object or null if there are none
Throws:
JCalParseException - if the jCal syntax is incorrect (the JSON syntax may be valid, but it is not in the correct jCal format).
JsonParseException - if the JSON syntax is incorrect
IOException - if there a problem reading from the data stream

all

public List<ICalendar> all()
                    throws IOException
Reads all iCalendar objects from the data stream.

Returns:
the parsed iCalendar objects
Throws:
JCalParseException - if the jCal syntax is incorrect (the JSON syntax may be valid, but it is not in the correct jCal format).
JsonParseException - if the JSON syntax is incorrect
IOException - if there's a problem reading from the data stream


Copyright © 2013 Michael Angstadt. All Rights Reserved.