|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiweekly.component.ICalComponent
biweekly.ICalendar
public class ICalendar
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);
Field Summary |
---|
Fields inherited from class biweekly.component.ICalComponent |
---|
components, properties |
Constructor Summary | |
---|---|
ICalendar()
Creates a new iCalendar object. |
Method Summary | |
---|---|
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<String> 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). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ICalendar()
Creates a new iCalendar object.
The following properties are auto-generated on object creation. These properties must be present in order for the iCalendar object to be valid:
Version
- Set to the default iCalendar version ("2.0").ProductId
- Set to a value that represents this library.
Method Detail |
---|
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 remove
public 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 remove
public List<VEvent> getEvents()
public void addEvent(VEvent event)
event
- the eventpublic List<VTodo> getTodos()
public void addTodo(VTodo todo)
todo
- the to-dopublic 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<String> warnings)
ICalComponent
validate
in class ICalComponent
components
- 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 to
IOException
- if there's an I/O problempublic void write(OutputStream out) throws IOException
out
- the data stream to write to
IOException
- if there's an I/O problempublic void write(Writer writer) throws IOException
writer
- the data stream to write to
IOException
- if there's an I/O problempublic String writeXml()
Biweekly
class instead, in order to register the marshaller
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 marshaller
classes.
file
- the file to write to
IllegalArgumentException
- if the iCalendar object contains
user-defined property or component objects
TransformerException
- if there's an I/O problem
IOException
- if the file cannot be written topublic void writeXml(OutputStream out) throws TransformerException
Biweekly
class instead, in order to register the marshaller
classes.
out
- the data stream to write to
IllegalArgumentException
- if the iCalendar object contains
user-defined property or component objects
TransformerException
- if there's an I/O problempublic void writeXml(Writer writer) throws TransformerException
Biweekly
class instead, in order to register the marshaller
classes.
writer
- the data stream to write to
IllegalArgumentException
- if the iCalendar object contains
user-defined property or component objects
TransformerException
- if there's an I/O problempublic String writeJson()
Biweekly
class instead, in order to register the marshaller
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 marshaller
classes.
file
- the file to write to
IllegalArgumentException
- if the iCalendar object contains
user-defined property or component objects
IOException
- if there's a problem writing to the filepublic void writeJson(OutputStream out) throws IOException
Biweekly
class instead, in order to register the marshaller
classes.
out
- the data stream to write to
IllegalArgumentException
- if the iCalendar object contains
user-defined property or component objects
IOException
- if there's a problem writing to the output streampublic void writeJson(Writer writer) throws IOException
Biweekly
class instead, in order to register the marshaller
classes.
writer
- the data stream to write to
IllegalArgumentException
- if the iCalendar object contains
user-defined property or component objects
IOException
- if there's a problem writing to the writer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |