public class FeedParser extends EventStream
Constructor and Description |
---|
FeedParser(java.lang.String feedUrl)
Create a new instance of FeedParser.
|
Modifier and Type | Method and Description |
---|---|
static org.licas_xml.abs.Element |
getAtomElement(org.licas_xml.abs.Element rootElem)
Get the base atom element, if maybe part of a larger document.
|
static org.licas_xml.abs.Element |
getFeedElement(org.licas_xml.abs.Element rootElem)
Get the base rss element, if maybe part of a larger document.
|
static org.licas_xml.abs.Element |
getRssElement(org.licas_xml.abs.Element rootElem)
Get the base rss element, if maybe part of a larger document.
|
protected static boolean |
hasItems(org.licas_xml.abs.Element rootElem)
Return true if the element has item child elements.
|
static boolean |
isAuthor(java.lang.String feedTkn)
Return true if the text token indicates a feed author description.
|
static boolean |
isChannel(java.lang.String feedTkn)
Return true if the text token indicates a feed channel.
|
static boolean |
isCopyright(java.lang.String feedTkn)
Return true if the text token indicates a feed copyright description.
|
static boolean |
isDescription(java.lang.String feedTkn)
Return true if the text token indicates a feed item description.
|
static boolean |
isFeedElement(org.licas_xml.abs.Element feedElem)
Return true if the root element is a feed element defined as the rss or atom type.
|
static boolean |
isGuid(java.lang.String feedTkn)
Return true if the text token indicates a feed id.
|
static boolean |
isItem(java.lang.String feedTkn)
Return true if the text token indicates a feed item.
|
static boolean |
isLanguage(java.lang.String feedTkn)
Return true if the text token indicates a feed language description.
|
static boolean |
isLink(java.lang.String feedTkn)
Return true if the text token indicates a feed link.
|
static boolean |
isPubDate(java.lang.String feedTkn)
Return true if the text token indicates a feed publication date.
|
static boolean |
isTitle(java.lang.String feedTkn)
Return true if the text token indicates a feed title.
|
static Feed |
parseFeed(org.licas_xml.abs.Element feedElem)
Parse the feed contents to create a feed.
|
Feed |
readFeed()
Read the feed contents online from the rss resource.
|
getStream, read
public FeedParser(java.lang.String feedUrl)
feedUrl
- the address to query.public Feed readFeed()
public static Feed parseFeed(org.licas_xml.abs.Element feedElem)
Item
elements for each feed item.feedElem
- the root element to parse from.public static org.licas_xml.abs.Element getFeedElement(org.licas_xml.abs.Element rootElem) throws java.lang.Exception
rootElem
- the root element to parse from.java.lang.Exception
- any error.public static org.licas_xml.abs.Element getRssElement(org.licas_xml.abs.Element rootElem) throws java.lang.Exception
rootElem
- the root element to parse from.java.lang.Exception
- any error.public static org.licas_xml.abs.Element getAtomElement(org.licas_xml.abs.Element rootElem) throws java.lang.Exception
rootElem
- the root element to parse from.java.lang.Exception
- any error.public static boolean isFeedElement(org.licas_xml.abs.Element feedElem)
feedElem
- the element to check.public static boolean isTitle(java.lang.String feedTkn)
feedTkn
- the string token to check.public static boolean isChannel(java.lang.String feedTkn)
feedTkn
- the string token to check.protected static boolean hasItems(org.licas_xml.abs.Element rootElem)
rootElem
- the root element to check to check.public static boolean isItem(java.lang.String feedTkn)
feedTkn
- the string token to check.public static boolean isDescription(java.lang.String feedTkn)
feedTkn
- the string token to check.public static boolean isLink(java.lang.String feedTkn)
feedTkn
- the string token to check.public static boolean isAuthor(java.lang.String feedTkn)
feedTkn
- the string token to check.public static boolean isGuid(java.lang.String feedTkn)
feedTkn
- the string token to check.public static boolean isPubDate(java.lang.String feedTkn)
feedTkn
- the string token to check.public static boolean isCopyright(java.lang.String feedTkn)
feedTkn
- the string token to check.public static boolean isLanguage(java.lang.String feedTkn)
feedTkn
- the string token to check.