|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sourceforge.rssowl.dao.feedparser.AbstractFeedParser
Abstract class of all parser classes in RSSOwl. Provides some methods to access values of the XML document. Is also responsible to parse Namespaces if available.
| Field Summary | |
protected org.jdom.Namespace |
content
Namespace: Content |
protected org.jdom.Namespace |
dc
Namespace: Dublin Core |
protected org.jdom.Namespace |
defNs
Namespace: Default |
protected org.jdom.Document |
document
Current document |
protected org.jdom.Namespace |
rdf
Namespace: RDF |
protected org.jdom.Element |
root
Root Element |
protected Channel |
rssChannel
Channel to fill with data |
protected org.jdom.Namespace |
sy
Namespace: Syndication |
protected String |
url
URL of the Newsfeed |
| Constructor Summary | |
protected |
AbstractFeedParser(org.jdom.Document document,
Channel rssChannel,
String url)
Instantiate a new Parser for this format. |
protected |
AbstractFeedParser(org.jdom.Document document,
Channel rssChannel,
String url,
org.jdom.Namespace[] nameSpaces)
Instantiate a new Parser for this format. |
| Method Summary | |
protected String |
getAttributeValue(org.jdom.Element element,
String attribute)
Get an attribute value from the document |
protected String |
getAttributeValue(org.jdom.Element element,
String attribute,
org.jdom.Namespace ns)
Get an attribute value from the document |
protected org.jdom.Element |
getChildElement(org.jdom.Element parent,
String name)
Get the Child Element of a parent Element |
protected org.jdom.Element |
getChildElement(org.jdom.Element parent,
String name,
org.jdom.Namespace ns)
Get the Child Element of a parent Element |
protected List |
getChildren(org.jdom.Element parent,
String name)
Get a list of children from the given element. |
protected List |
getChildren(org.jdom.Element parent,
String name,
org.jdom.Namespace ns)
Get a list of children from the given element. |
protected String |
getChildValue(String element,
org.jdom.Element parent)
Get a value from the document |
protected String |
getChildValue(String element,
org.jdom.Element parent,
org.jdom.Namespace ns)
Get a value from the document |
protected abstract void |
parse()
Parse elements that are defined in the specifications and add them to the Channel. |
private void |
parseAvailableNamespaces()
Parse document for namespaces |
protected void |
parseContentModule(org.jdom.Element item,
NewsItem newsItem)
Parse the content module namespace |
protected void |
parseDCModule(org.jdom.Element item,
NewsItem newsItem)
Parse for the dublin core module namespace |
private void |
parseRoot()
Parse the Root Element from the XML document. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected org.jdom.Namespace content
protected org.jdom.Namespace dc
protected org.jdom.Namespace defNs
protected org.jdom.Document document
protected org.jdom.Namespace rdf
protected org.jdom.Element root
protected Channel rssChannel
protected org.jdom.Namespace sy
protected String url
| Constructor Detail |
protected AbstractFeedParser(org.jdom.Document document,
Channel rssChannel,
String url)
throws NewsfeedFactoryException
document - The document containing the data to parserssChannel - The Channel to fill with data from the documenturl - The URL of the Newsfeed that is parsed
NewsfeedFactoryException - If any error occurs
protected AbstractFeedParser(org.jdom.Document document,
Channel rssChannel,
String url,
org.jdom.Namespace[] nameSpaces)
throws NewsfeedFactoryException
document - The document containing the data to parserssChannel - The Channel to fill with data from the documenturl - The URL of the Newsfeed that is parsednameSpaces - Possible Namespaces of the XML document
NewsfeedFactoryException - If any error occurs| Method Detail |
private void parseAvailableNamespaces()
private void parseRoot()
throws NewsfeedFactoryException
NewsfeedFactoryException - If the root element is not set.
protected String getAttributeValue(org.jdom.Element element,
String attribute)
element - The element's nameattribute - The attributes name
protected String getAttributeValue(org.jdom.Element element,
String attribute,
org.jdom.Namespace ns)
element - The element's nameattribute - The attributes namens - The namespace for the attribute
protected org.jdom.Element getChildElement(org.jdom.Element parent,
String name)
parent - The parent of the childname - The name of the child
protected org.jdom.Element getChildElement(org.jdom.Element parent,
String name,
org.jdom.Namespace ns)
parent - The parent of the childname - The name of the childns - The namespace for the child
protected List getChildren(org.jdom.Element parent,
String name)
parent - The parent elementname - The name of the children
protected List getChildren(org.jdom.Element parent,
String name,
org.jdom.Namespace ns)
parent - The parent elementname - The name of the childrenns - The namespace
protected String getChildValue(String element,
org.jdom.Element parent)
element - The element's nameparent - The parent element
protected String getChildValue(String element,
org.jdom.Element parent,
org.jdom.Namespace ns)
element - The element's nameparent - The parent elementns - The Namespace to use
protected abstract void parse()
throws NewsfeedFactoryException
NewsfeedFactoryException - If any error occurs
protected void parseContentModule(org.jdom.Element item,
NewsItem newsItem)
item - Current working itemnewsItem - Current working newsItem
protected void parseDCModule(org.jdom.Element item,
NewsItem newsItem)
item - Current working itemnewsItem - Current working newsitem
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||