org.eclipse.ecf.provider.rss.channel
Class RSSParserBase

java.lang.Object
  extended by org.eclipse.ecf.provider.rss.channel.RSSParserBase
Direct Known Subclasses:
RSSParser_2_0

public class RSSParserBase
extends java.lang.Object

The base class for RSS parsers.

Author:
Sergey Yakovlev

Constructor Summary
RSSParserBase()
           
 
Method Summary
protected static RssFeed createFeed(org.w3c.dom.Element channel)
          Creates a RssFeed object from the Element representation.
protected static SseHistory createHistory(org.w3c.dom.Element historyElement)
          Creates a SseHistory object from the Element representation.
static RssItem createItem(RssFeed feed, java.lang.String title, java.lang.String description, java.lang.String link)
          Creates an item with the specified owner feed, title, link and description.
protected static SseSharing createSharing(org.w3c.dom.Element sharingElement)
          Creates a SseSharing object from the Element representation.
protected static SseSync createSync(org.w3c.dom.Element syncElement)
          Creates a SseSync object from the Element representation.
protected static org.w3c.dom.Node getFirstChild(org.w3c.dom.Element parent, java.lang.String childName)
          Returns a first Node of all descendant Elements with a given tag name.
protected static org.w3c.dom.Node getFirstChildNS(org.w3c.dom.Element parent, java.lang.String namespaceURI, java.lang.String childName)
          Returns a first Node of all descendant Elements with a given tag name and namespace URI.
protected static java.lang.String getFirstChildValue(org.w3c.dom.Element parent, java.lang.String childName)
          The string value of specified node.
protected static java.lang.String getFirstChildValue(org.w3c.dom.Element parent, java.lang.String childName, java.lang.String defaultValue)
          The string value of specified node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RSSParserBase

public RSSParserBase()
Method Detail

createFeed

protected static RssFeed createFeed(org.w3c.dom.Element channel)
Creates a RssFeed object from the Element representation.

Parameters:
channel - - the Element object containing the attributes to be copied.
Returns:
created feed.

createItem

public static RssItem createItem(RssFeed feed,
                                 java.lang.String title,
                                 java.lang.String description,
                                 java.lang.String link)
Creates an item with the specified owner feed, title, link and description.

Parameters:
feed - - the owner feed object.
title - - the title to use.
description - - the description
link - - the link
Returns:
created item.

createSharing

protected static SseSharing createSharing(org.w3c.dom.Element sharingElement)
Creates a SseSharing object from the Element representation.

Parameters:
sharingElement - - the Element object containing the attributes to be copied.
Returns:
created sharing element.

createSync

protected static SseSync createSync(org.w3c.dom.Element syncElement)
                             throws ParseException
Creates a SseSync object from the Element representation.

Parameters:
syncElement - - the Element object containing the attributes to be copied.
Returns:
created sync element.
Throws:
ParseException - - If any parse errors occur during processing.

createHistory

protected static SseHistory createHistory(org.w3c.dom.Element historyElement)
Creates a SseHistory object from the Element representation.

Parameters:
historyElement - - the Element object containing the attributes to be copied.
Returns:
created history element.

getFirstChild

protected static org.w3c.dom.Node getFirstChild(org.w3c.dom.Element parent,
                                                java.lang.String childName)
Returns a first Node of all descendant Elements with a given tag name.

Parameters:
parent - - The specified node to search in.
childName - - The name of the tag to match on. The special value "*" matches all tags.
Returns:
A first node of matching Element nodes.

getFirstChildNS

protected static org.w3c.dom.Node getFirstChildNS(org.w3c.dom.Element parent,
                                                  java.lang.String namespaceURI,
                                                  java.lang.String childName)
Returns a first Node of all descendant Elements with a given tag name and namespace URI.

Parameters:
parent - - The specified node to search in.
namespaceURI - - The namespace URI of the elements to match on. The special value "*" matches all namespaces.
childName - - The name of the tag to match on. The special value "*" matches all tags.
Returns:
A first node of matching Element nodes.

getFirstChildValue

protected static java.lang.String getFirstChildValue(org.w3c.dom.Element parent,
                                                     java.lang.String childName)
The string value of specified node.

Parameters:
parent - - The specified node to search in.
childName - - The name of the tag to match on. The special value "*" matches all tags.
Returns:
String value.

getFirstChildValue

protected static java.lang.String getFirstChildValue(org.w3c.dom.Element parent,
                                                     java.lang.String childName,
                                                     java.lang.String defaultValue)
The string value of specified node.

Parameters:
parent - - The specified node to search in.
childName - - The name of the tag to match on. The special value "*" matches all tags.
defaultValue - - a default value.
Returns:
String value.