org.openprivacy.reptile.feeds.xml
Class OCSContentFeedsHandler

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--org.openprivacy.reptile.feeds.xml.OCSContentFeedsHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class OCSContentFeedsHandler
extends org.xml.sax.helpers.DefaultHandler

Handles parsing out content feeds and starting them up. Required features: - reset state when we encounter the end of the entry which had an rdf:about element - only register supported formats - overwrite the registration if a preferred format is found fora given URL. IE if find an RSS 1.0 URL and there is already an RSS 0.9x URL then overwrite it. - it is possible that certain URLs have multiple formats... support this too. - Have a reset method which can reset the state so that titles, etc are reset.

Version:
$Id: OCSContentFeedsHandler.java,v 1.6 2002/02/26 06:48:04 burton Exp $
Author:
burtonator

Constructor Summary
OCSContentFeedsHandler(java.io.File file)
          Used for testing purposes.
OCSContentFeedsHandler(org.xml.sax.InputSource is)
           
OCSContentFeedsHandler(java.io.InputStream is)
           
OCSContentFeedsHandler(java.lang.String feedLocation)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endElement(java.lang.String ns_uri, java.lang.String local, java.lang.String qName)
           
static boolean isDCNamespace(java.lang.String namespace)
          Return true if the given namespace is an OCS namespace.
static boolean isOCSNamespace(java.lang.String namespace)
          Return true if the given namespace is an OCS namespace.
static void main(java.lang.String[] args)
           
 void startElement(java.lang.String ns_uri, java.lang.String local, java.lang.String raw, org.xml.sax.Attributes attrs)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OCSContentFeedsHandler

public OCSContentFeedsHandler(java.io.InputStream is)
                       throws ReptileException

OCSContentFeedsHandler

public OCSContentFeedsHandler(org.xml.sax.InputSource is)
                       throws ReptileException

OCSContentFeedsHandler

public OCSContentFeedsHandler(java.lang.String feedLocation)
                       throws ReptileException

OCSContentFeedsHandler

public OCSContentFeedsHandler(java.io.File file)
                       throws java.lang.Exception
Used for testing purposes. This allows us to give it a file and parse it out manually.

Method Detail

startElement

public void startElement(java.lang.String ns_uri,
                         java.lang.String local,
                         java.lang.String raw,
                         org.xml.sax.Attributes attrs)
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler

endElement

public void endElement(java.lang.String ns_uri,
                       java.lang.String local,
                       java.lang.String qName)
Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler

characters

public void characters(char[] ch,
                       int start,
                       int length)
Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler

isOCSNamespace

public static boolean isOCSNamespace(java.lang.String namespace)
Return true if the given namespace is an OCS namespace.


isDCNamespace

public static boolean isDCNamespace(java.lang.String namespace)
Return true if the given namespace is an OCS namespace.


main

public static void main(java.lang.String[] args)