|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbiweekly.io.json.JCalReader
public class JCalReader
Parses ICalendar objects from a jCal data stream (JSON).
Example:
InputStream in = ...
JCalReader jcalReader = new JCalReader(in);
ICalendar ical;
while ((ical = jcalReader.readNext()) != null){
...
}
jcalReader.close();
| Constructor Summary | |
|---|---|
JCalReader(File file)
Creates a jCard reader. |
|
JCalReader(InputStream in)
Creates a jCard reader. |
|
JCalReader(Reader reader)
Creates a jCard reader. |
|
JCalReader(String json)
Creates a jCard reader. |
|
| Method Summary | |
|---|---|
void |
close()
|
ICalMarshallerRegistrar |
getRegistrar()
Gets the object that manages the component/property marshaller objects. |
List<String> |
getWarnings()
Gets the warnings from the last iCalendar object that was unmarshalled. |
ICalendar |
readNext()
Reads the next iCalendar object from the JSON data stream. |
void |
registerMarshaller(ICalComponentMarshaller<? extends ICalComponent> marshaller)
Registers an experimental component marshaller. |
void |
registerMarshaller(ICalPropertyMarshaller<? extends ICalProperty> marshaller)
Registers an experimental property marshaller. |
void |
setRegistrar(ICalMarshallerRegistrar registrar)
Sets the object that manages the component/property marshaller objects. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JCalReader(String json)
json - the JSON stringpublic JCalReader(InputStream in)
in - the input stream to read the vCards from
public JCalReader(File file)
throws FileNotFoundException
file - the file to read the vCards from
FileNotFoundException - if the file doesn't existpublic JCalReader(Reader reader)
reader - the reader to read the vCards from| Method Detail |
|---|
public List<String> getWarnings()
public void registerMarshaller(ICalPropertyMarshaller<? extends ICalProperty> marshaller)
Registers an experimental property marshaller. Can also be used to override the marshaller of a standard property (such as DTSTART). Calling this method is the same as calling:
getRegistrar().register(marshaller).
marshaller - the marshaller to registerpublic void registerMarshaller(ICalComponentMarshaller<? extends ICalComponent> marshaller)
Registers an experimental component marshaller. Can also be used to override the marshaller of a standard component (such as VEVENT). Calling this method is the same as calling:
getRegistrar().register(marshaller).
marshaller - the marshaller to registerpublic ICalMarshallerRegistrar getRegistrar()
public void setRegistrar(ICalMarshallerRegistrar registrar)
registrar - the marshaller registrar
public ICalendar readNext()
throws IOException
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 is a problem reading from the data stream
public void close()
throws IOException
close in interface CloseableIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||