public class ICalendar extends ICalComponent
Represents an iCalendar object.
Examples:
ICalendar ical = new ICalendar();
VEvent event = new VEvent();
event.setSummary("Team Meeting");
Date start = ...;
event.setDateStart(start);
Date end = ...;
event.setDateEnd(end);
ical.addEvent(event);
components, properties| Constructor and Description |
|---|
ICalendar()
Creates a new iCalendar object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEvent(VEvent event)
Adds an event.
|
void |
addFreeBusy(VFreeBusy freeBusy)
Adds a free/busy entry.
|
void |
addJournal(VJournal journal)
Adds a journal entry.
|
void |
addTimezone(VTimezone timezone)
Adds a timezone.
|
void |
addTodo(VTodo todo)
Adds a to-do.
|
CalendarScale |
getCalendarScale()
Gets the calendar system that this iCalendar object uses.
|
List<VEvent> |
getEvents()
Gets the events.
|
List<VFreeBusy> |
getFreeBusies()
Gets the free/busy entries.
|
List<VJournal> |
getJournals()
Gets the journal entries.
|
Method |
getMethod()
Gets the value of the Content-Type "method" parameter if the iCalendar
object is defined as a MIME message entity.
|
ProductId |
getProductId()
Gets the name of the application that created the iCalendar object.
|
List<VTimezone> |
getTimezones()
Gets the timezones.
|
List<VTodo> |
getTodos()
Gets the to-dos.
|
Version |
getVersion()
Gets the min/max versions a consumer must support in order to
successfully parse the iCalendar object.
|
void |
setCalendarScale(CalendarScale calendarScale)
Sets the calendar system that this iCalendar object uses.
|
void |
setMethod(Method method)
Sets the value of the Content-Type "method" parameter if the iCalendar
object is defined as a MIME message entity.
|
Method |
setMethod(String method)
Sets the value of the Content-Type "method" parameter if the iCalendar
object is defined as a MIME message entity.
|
void |
setProductId(ProductId prodId)
Sets the name of the application that created the iCalendar object.
|
ProductId |
setProductId(String prodId)
Sets the application that created the iCalendar object.
|
void |
setVersion(Version version)
Sets the min/max versions a consumer must support in order to
successfully parse the iCalendar object.
|
ValidationWarnings |
validate()
Checks this iCalendar object for data consistency problems or deviations
from the spec.
|
protected void |
validate(List<ICalComponent> components,
List<Warning> warnings)
Checks the component for data consistency problems or deviations from the
spec.
|
String |
write()
Marshals this iCalendar object to its plain text representation.
|
void |
write(File file)
Marshals this iCalendar object to its plain text representation.
|
void |
write(OutputStream out)
Marshals this iCalendar object to its plain text representation.
|
void |
write(Writer writer)
Marshals this iCalendar object to its plain text representation.
|
String |
writeJson()
Marshals this iCalendar object to its JSON representation (jCal).
|
void |
writeJson(File file)
Marshals this iCalendar object to its JSON representation (jCal).
|
void |
writeJson(OutputStream out)
Marshals this iCalendar object to its JSON representation (jCal).
|
void |
writeJson(Writer writer)
Marshals this iCalendar object to its JSON representation (jCal).
|
String |
writeXml()
Marshals this iCalendar object to its XML representation (xCal).
|
void |
writeXml(File file)
Marshals this iCalendar object to its XML representation (xCal).
|
void |
writeXml(OutputStream out)
Marshals this iCalendar object to its XML representation (xCal).
|
void |
writeXml(Writer writer)
Marshals this iCalendar object to its XML representation (xCal).
|
addComponent, addExperimentalComponent, addExperimentalProperty, addExperimentalProperty, addProperty, checkOptionalCardinality, checkRequiredCardinality, checkStatus, getComponent, getComponents, getComponents, getExperimentalComponent, getExperimentalComponents, getExperimentalComponents, getExperimentalProperties, getExperimentalProperties, getExperimentalProperty, getProperties, getProperties, getProperty, removeExperimentalComponents, removeExperimentalProperty, removeProperties, setComponent, setComponent, setExperimentalComponents, setExperimentalProperty, setExperimentalProperty, setProperty, setProperty, validatepublic ICalendar()
public Version getVersion()
ICalendar objects
are initialized with a version of "2.0" (the default version). It is a
required property.public void setVersion(Version version)
ICalendar objects
are initialized with a version of "2.0" (the default version). It is a
required property.version - the versionpublic ProductId getProductId()
ICalendar objects are initialized with a product ID representing
this library. It is a required property.public void setProductId(ProductId prodId)
ICalendar objects are initialized with a product ID representing
this library. It is a required property.prodId - the property instance or null to removepublic ProductId setProductId(String prodId)
ICalendar objects are initialized with a product ID representing
this library.prodId - a unique string representing the application (e.g.
"-//Company//Application//EN") or null to removepublic CalendarScale getCalendarScale()
public void setCalendarScale(CalendarScale calendarScale)
calendarScale - the calendar system or null to removepublic Method getMethod()
public void setMethod(Method method)
method - the property or null to removepublic Method setMethod(String method)
method - the method or null to removepublic List<VJournal> getJournals()
public void addJournal(VJournal journal)
journal - the journal entrypublic List<VFreeBusy> getFreeBusies()
public void addFreeBusy(VFreeBusy freeBusy)
freeBusy - the free/busy entrypublic List<VTimezone> getTimezones()
public void addTimezone(VTimezone timezone)
timezone - the timezonepublic ValidationWarnings validate()
protected void validate(List<ICalComponent> components, List<Warning> warnings)
ICalComponentvalidate in class ICalComponentcomponents - the hierarchy of components that the component belongs
towarnings - the list to add the warnings topublic String write()
public void write(File file) throws IOException
file - the file to write toIOException - if there's an I/O problempublic void write(OutputStream out) throws IOException
out - the data stream to write toIOException - if there's an I/O problempublic void write(Writer writer) throws IOException
writer - the data stream to write toIOException - if there's an I/O problempublic String writeXml()
Biweekly class instead, in order to register the scribe
classes.IllegalArgumentException - if the iCalendar object contains
user-defined property or component objectspublic void writeXml(File file) throws TransformerException, IOException
Biweekly class instead, in order to register the scribe
classes.file - the file to write toIllegalArgumentException - if the iCalendar object contains
user-defined property or component objectsTransformerException - if there's an I/O problemIOException - if the file cannot be written topublic void writeXml(OutputStream out) throws TransformerException
Biweekly class instead, in order to register the scribe
classes.out - the data stream to write toIllegalArgumentException - if the iCalendar object contains
user-defined property or component objectsTransformerException - if there's an I/O problempublic void writeXml(Writer writer) throws TransformerException
Biweekly class instead, in order to register the scribe
classes.writer - the data stream to write toIllegalArgumentException - if the iCalendar object contains
user-defined property or component objectsTransformerException - if there's an I/O problempublic String writeJson()
Biweekly class instead, in order to register the scribe
classes.IllegalArgumentException - if the iCalendar object contains
user-defined property or component objectspublic void writeJson(File file) throws IOException
Biweekly class instead, in order to register the scribe
classes.file - the file to write toIllegalArgumentException - if the iCalendar object contains
user-defined property or component objectsIOException - if there's a problem writing to the filepublic void writeJson(OutputStream out) throws IOException
Biweekly class instead, in order to register the scribe
classes.out - the data stream to write toIllegalArgumentException - if the iCalendar object contains
user-defined property or component objectsIOException - if there's a problem writing to the output streampublic void writeJson(Writer writer) throws IOException
Biweekly class instead, in order to register the scribe
classes.writer - the data stream to write toIllegalArgumentException - if the iCalendar object contains
user-defined property or component objectsIOException - if there's a problem writing to the writerCopyright © 2013-2014 Michael Angstadt. All Rights Reserved.