org.jperdian.rss2
Class RssParseHelper

java.lang.Object
  |
  +--org.jperdian.rss2.RssParseHelper

public class RssParseHelper
extends java.lang.Object

Some static methods for easy access to parse additions

Author:
Christian Robert

Constructor Summary
RssParseHelper()
           
 
Method Summary
static java.lang.String parseContentChildren(org.w3c.dom.Node node)
          Parse the content of the children from the specified node and return it as String.
static java.util.Date parseContentDate(org.w3c.dom.Element node)
          Parses the content of the given element and formats it as date, or returns null if no content could be read
static int parseContentInt(org.w3c.dom.Element node)
          Parses the content of the given element and formats it as number, or returns 0 if no content could be read
static int parseContentInt(org.w3c.dom.Element node, int defaultValue)
          Parses the content of the given element and formats it as number, or returns the default value if no content could be read
static java.net.URL parseContentURL(org.w3c.dom.Element node)
          Parses the content of the given element and formats it as URL
static java.net.URL parseURL(java.lang.String sourceString)
          Parses the given source String into a URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RssParseHelper

public RssParseHelper()
Method Detail

parseURL

public static java.net.URL parseURL(java.lang.String sourceString)
                             throws RssParseException
Parses the given source String into a URL. If no value has been entered null will be returned

Throws:
RssParseException - thrown if the given URL is not valid

parseContentChildren

public static java.lang.String parseContentChildren(org.w3c.dom.Node node)
Parse the content of the children from the specified node and return it as String.

Parameters:
node - the content which children should be parsed
Returns:
the parse result content

parseContentDate

public static java.util.Date parseContentDate(org.w3c.dom.Element node)
                                       throws RssParseException
Parses the content of the given element and formats it as date, or returns null if no content could be read

RssParseException

parseContentInt

public static int parseContentInt(org.w3c.dom.Element node)
                           throws RssParseException
Parses the content of the given element and formats it as number, or returns 0 if no content could be read

RssParseException

parseContentInt

public static int parseContentInt(org.w3c.dom.Element node,
                                  int defaultValue)
                           throws RssParseException
Parses the content of the given element and formats it as number, or returns the default value if no content could be read

RssParseException

parseContentURL

public static java.net.URL parseContentURL(org.w3c.dom.Element node)
                                    throws RssParseException
Parses the content of the given element and formats it as URL

RssParseException