public class ICalReader extends Object implements Closeable
Parses ICalendar
objects from an iCalendar data stream.
Example:
InputStream in = ... ICalReader icalReader = new ICalReader(in); ICalendar ical; while ((ical = icalReader.readNext()) != null){ ... } icalReader.close();
Constructor and Description |
---|
ICalReader(File file)
Creates a reader that parses iCalendar objects from a file.
|
ICalReader(InputStream in)
Creates a reader that parses iCalendar objects from an input stream.
|
ICalReader(Reader reader)
Creates a reader that parses iCalendar objects from a reader.
|
ICalReader(String string)
Creates a reader that parses iCalendar objects from a string.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying
Reader object. |
ScribeIndex |
getScribeIndex()
Gets the object that manages the component/property scribes.
|
List<String> |
getWarnings()
Gets the warnings from the last iCalendar object that was unmarshalled.
|
boolean |
isCaretDecodingEnabled()
Gets whether the reader will decode parameter values that use circumflex
accent encoding (enabled by default).
|
ICalendar |
readNext()
Reads the next iCalendar object.
|
void |
registerScribe(ICalComponentScribe<? extends ICalComponent> scribe)
Registers an experimental component scribe.
|
void |
registerScribe(ICalPropertyScribe<? extends ICalProperty> scribe)
Registers an experimental property scribe.
|
void |
setCaretDecodingEnabled(boolean enable)
Sets whether the reader will decode parameter values that use circumflex
accent encoding (enabled by default).
|
void |
setScribeIndex(ScribeIndex index)
Sets the object that manages the component/property scribes.
|
public ICalReader(String string)
string
- the stringpublic ICalReader(InputStream in)
in
- the input streampublic ICalReader(File file) throws FileNotFoundException
file
- the fileFileNotFoundException
- if the file doesn't existpublic ICalReader(Reader reader)
reader
- the readerpublic boolean isCaretDecodingEnabled()
ICalRawReader.isCaretDecodingEnabled()
public void setCaretDecodingEnabled(boolean enable)
enable
- true to use circumflex accent decoding, false not toICalRawReader.setCaretDecodingEnabled(boolean)
public void registerScribe(ICalPropertyScribe<? extends ICalProperty> scribe)
Registers an experimental property scribe. Can also be used to override the scribe of a standard property (such as DTSTART). Calling this method is the same as calling:
getScribeIndex().register(scribe)
.
scribe
- the scribe to registerpublic void registerScribe(ICalComponentScribe<? extends ICalComponent> scribe)
Registers an experimental component scribe. Can also be used to override the scribe of a standard component (such as VEVENT). Calling this method is the same as calling:
getScribeIndex().register(scribe)
.
scribe
- the scribe to registerpublic ScribeIndex getScribeIndex()
public void setScribeIndex(ScribeIndex index)
index
- the scribe indexpublic List<String> getWarnings()
public ICalendar readNext() throws IOException
IOException
- if there's a problem reading from the streampublic void close() throws IOException
Reader
object.close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2013-2014 Michael Angstadt. All Rights Reserved.