CalendarParser that parses XHTML documents that include calendar data marked up with the hCalendar
microformat.
The parser treats the entire document as a single "vcalendar" context, ignoring any vcalendar elements
and adding all components in the document to a single generated calendar.
Since hCalendar does not include product information, the PRODID property is omitted from the generated
calendar. The hCalendar profile is supposed to define the iCalendar version that it represents, but it does not, so
version 2.0 is assumed.
This parser recognizes only "vevent" components.
This parser recognizes the following properties:
hCalendar allows for some properties to be represented by nested microformat records, including hCard, adr and geo. This parser does not recognize these records. It simply accumulates the text content of any child elements of the property element and uses the resulting string as the property value.
hCalendar date-time values are formatted according to RFC 3339. There is no representation in this specification for time zone ids. All date-times are specified either in UTC or with an offset that can be used to convert the local time into UTC. Neither does hCal provide a reprsentation for floating date-times. Therefore, all date-time values produced by this parser are in UTC.
Some examples in the wild provide date and date-time values in iCalendar format rather than RFC 3339 format. Although not technically legal according to spec, these values are accepted. In this case, floating date-times are produced by the parser.
hCalendar does not define attributes, nested elements or other information elements representing parameter data. Therefore, this parser does not set any property parameters except as implied by property value data (e.g. VALUE=DATE-TIME or VALUE=DATE for date-time properties).
| Modifier and Type | Field and Description |
|---|---|
| private static final DocumentBuilderFactory | |
| private static final SimpleDateFormat | |
| private static final String | |
| private static final SimpleDateFormat | |
| private static final String | |
| private static final Logger | |
| private static final XPath | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression | |
| private static final XPathExpression |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| private void | |
| private static String | |
| private static XPathExpression | |
| private static Element | |
| private static List | |
| private static Node | |
| private static NodeList | |
| private static String | |
| private static Date | |
| private static boolean | |
| private static boolean | |
| private static boolean | |
| private static boolean | |
| public void | parse(InputStream
an input stream from which to read iCalendar data in, ContentHandler the content handler to notify during parsing handler)Implements net. Parse the iCalendar data from the specified input stream. |
| public void | parse(Reader
a reader from which to read iCalendar data in, ContentHandler the content handler to notify during parsing handler)Implements net. Parse the iCalendar data from the specified reader. |
| private void |
| BUILDER_FACTORY | back to summary |
|---|---|
| private static final DocumentBuilderFactory BUILDER_FACTORY | |
| HCAL_DATE_FORMAT | back to summary |
|---|---|
| private static final SimpleDateFormat HCAL_DATE_FORMAT | |
| HCAL_DATE_PATTERN | back to summary |
|---|---|
| private static final String HCAL_DATE_PATTERN | |
| HCAL_DATE_TIME_FORMAT | back to summary |
|---|---|
| private static final SimpleDateFormat HCAL_DATE_TIME_FORMAT | |
| HCAL_DATE_TIME_PATTERN | back to summary |
|---|---|
| private static final String HCAL_DATE_TIME_PATTERN | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| XPATH | back to summary |
|---|---|
| private static final XPath XPATH | |
| XPATH_ATTACH | back to summary |
|---|---|
| private static final XPathExpression XPATH_ATTACH | |
| XPATH_ATTENDEE | back to summary |
|---|---|
| private static final XPathExpression XPATH_ATTENDEE | |
| XPATH_CATEGORY | back to summary |
|---|---|
| private static final XPathExpression XPATH_CATEGORY | |
| XPATH_CLASS | back to summary |
|---|---|
| private static final XPathExpression XPATH_CLASS | |
| XPATH_CONTACT | back to summary |
|---|---|
| private static final XPathExpression XPATH_CONTACT | |
| XPATH_DESCRIPTION | back to summary |
|---|---|
| private static final XPathExpression XPATH_DESCRIPTION | |
| XPATH_DTEND | back to summary |
|---|---|
| private static final XPathExpression XPATH_DTEND | |
| XPATH_DTSTAMP | back to summary |
|---|---|
| private static final XPathExpression XPATH_DTSTAMP | |
| XPATH_DTSTART | back to summary |
|---|---|
| private static final XPathExpression XPATH_DTSTART | |
| XPATH_DURATION | back to summary |
|---|---|
| private static final XPathExpression XPATH_DURATION | |
| XPATH_LAST_MODIFIED | back to summary |
|---|---|
| private static final XPathExpression XPATH_LAST_MODIFIED | |
| XPATH_LOCATION | back to summary |
|---|---|
| private static final XPathExpression XPATH_LOCATION | |
| XPATH_METHOD | back to summary |
|---|---|
| private static final XPathExpression XPATH_METHOD | |
| XPATH_ORGANIZER | back to summary |
|---|---|
| private static final XPathExpression XPATH_ORGANIZER | |
| XPATH_SEQUENCE | back to summary |
|---|---|
| private static final XPathExpression XPATH_SEQUENCE | |
| XPATH_STATUS | back to summary |
|---|---|
| private static final XPathExpression XPATH_STATUS | |
| XPATH_SUMMARY | back to summary |
|---|---|
| private static final XPathExpression XPATH_SUMMARY | |
| XPATH_UID | back to summary |
|---|---|
| private static final XPathExpression XPATH_UID | |
| XPATH_URL | back to summary |
|---|---|
| private static final XPathExpression XPATH_URL | |
| XPATH_VEVENTS | back to summary |
|---|---|
| private static final XPathExpression XPATH_VEVENTS | |
| HCalendarParser | back to summary |
|---|---|
| public HCalendarParser() | |
| buildCalendar | back to summary |
|---|---|
| private void buildCalendar(Document d, ContentHandler handler) throws ParserException, IOException | |
| buildEvent | back to summary |
|---|---|
| private void buildEvent(Element element, ContentHandler handler) throws ParserException | |
| buildProperty | back to summary |
|---|---|
| private void buildProperty(Element element, String propName, ContentHandler handler) throws ParserException | |
| className | back to summary |
|---|---|
| private static String className(String propName) | |
| compileExpression | back to summary |
|---|---|
| private static XPathExpression compileExpression(String expr) | |
| findElement | back to summary |
|---|---|
| private static Element findElement(XPathExpression expr, Object context) throws ParserException | |
| findElements | back to summary |
|---|---|
| private static List | |
| findNode | back to summary |
|---|---|
| private static Node findNode(XPathExpression expr, Object context) throws ParserException | |
| findNodes | back to summary |
|---|---|
| private static NodeList findNodes(XPathExpression expr, Object context) throws ParserException | |
| getTextContent | back to summary |
|---|---|
| private static String getTextContent(Element element) throws ParserException | |
| icalDate | back to summary |
|---|---|
| private static Date icalDate(String original) throws ParseException
References Deprecated
See corresponding docs for further information. | |
| isDateProperty | back to summary |
|---|---|
| private static boolean isDateProperty(String name) | |
| isHeaderElement | back to summary |
|---|---|
| private static boolean isHeaderElement(String name) | |
| isTextProperty | back to summary |
|---|---|
| private static boolean isTextProperty(String name) | |
| isUrlProperty | back to summary |
|---|---|
| private static boolean isUrlProperty(String name) | |
| parse | back to summary |
|---|---|
| public void parse(InputStream in, ContentHandler handler) throws IOException, ParserException Implements net. Doc from net. Parse the iCalendar data from the specified input stream.
| |
| parse | back to summary |
|---|---|
| public void parse(Reader in, ContentHandler handler) throws IOException, ParserException Implements net. Doc from net. Parse the iCalendar data from the specified reader.
| |
| parse | back to summary |
|---|---|
| private void parse(InputSource in, ContentHandler handler) throws IOException, ParserException | |