Class CalendarFeedParser
Occurrences, not series. A recurring event is expanded by ical4j — RRULE, RDATE and EXDATE, in the event's own time zone, daylight saving included — within the window, and each instance a RECURRENCE-ID override replaces is taken from the override. Agenda's recurrence model cannot hold every rule a feed may carry, and an expansion is one truthful path for all of them. Every occurrence is identified by its UID and the instant it was originally scheduled at, so a refresh finds the same occurrence again.
What is kept: title, location and description as plain text, the times, whether the event is all-day, and its transparency. A cancelled event or instance is left out. Organizers, attendees, alarms, attachments and URLs are never read.
Bounds: rules repeating by the second or the minute are not expanded,
the expansion stops once it has produced four times the number of occurrences
kept, and only the earliest maxEvents occurrences are kept.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne occurrence, ready to be written as an agenda event.static final recordA document read. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intLongest description kept, in characters of plain text.static final intLongest calendar name kept.static final intLongest title or location kept. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdescriptionMarkup(String text) Turns a plain-text description into the markup agenda renders a description with: escaped, line breaks kept.Reads a document.
-
Field Details
-
MAX_TEXT
public static final int MAX_TEXTLongest title or location kept.- See Also:
-
MAX_DESCRIPTION
public static final int MAX_DESCRIPTIONLongest description kept, in characters of plain text.- See Also:
-
MAX_NAME
public static final int MAX_NAMELongest calendar name kept.- See Also:
-
-
Method Details
-
parse
public static CalendarFeedParser.ParsedCalendar parse(byte[] body, Instant windowStart, Instant windowEnd, int maxEvents) throws CalendarFeedException Reads a document.- Parameters:
body- the bytes read, UTF-8windowStart- occurrences ending at or before this instant are left outwindowEnd- occurrences starting at or after this instant are left outmaxEvents- most occurrences kept- Returns:
- the document read
- Throws:
CalendarFeedException- when the body is not an iCalendar document, or cannot be read as one
-
descriptionMarkup
Turns a plain-text description into the markup agenda renders a description with: escaped, line breaks kept.- Parameters:
text- plain text, may be null- Returns:
- the markup, null for no text
-