Oracle Blog

Java, JavaFX and beyond...

Tuesday Sep 15, 2009

In one of my previous post I have described the use of RSS and ATOM Task to parse the feeds.

Unfortunately many feeds do not strictly comply with the RSS/ATOM format. Example: In some cases the date specified for pubDate element may be in wrong format, or its an invalid date or the information specified is embedded in CDATA instead of TEXT. The parser will fail for such scenarios. Hence we need to implement custom parsers so as to handle the situation.

Both RssTask and AtomTask API provide an attribute - factory - which can be used to specify custom implementation of RSS or ATOM Factory. Users may also customize various elements such as Channel, Item, Entry, Feed by overriding functions such as - fromXML, tryParseDate etc.

Example: In some cases the default parser fails to convert pubDate to valid DateTime instance. So a new attribute - pubDateText - is added so as to save the date as String.

Thursday Jun 18, 2009

JavaFX 1.2 provides new APIs to handle RSS and ATOM feeds. RssTask and AtomTask parses the feeds and provide the content as JavaFX objects. It can also be configured to provide updates on regular intervals.

RssTask parses the feed and provides the content as Channel and Item objects. These objects in-turn provides other information such as image, link, title, category, date etc.