|
Copyright (c) 2000-2002 ChurchillObjects.com | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.helpers.DefaultHandler | +--churchillobjects.rss4j.parser.RssParser
This parser is really a 'bootstrap' parser, whose only real purpose is to identify what version the RSS document is and then instantiate and pass processing along to a parser appropriate to that version. Its functionality is available to client code only through its set of public static parse methods, each of which takes a different variety of input and converts it to an InputSource for the SAX handler.
Field Summary | |
private java.lang.StringBuffer |
characters
Holds a buffer of characters for the current element. |
protected churchillobjects.rss4j.RssChannel |
currentChannel
Holds the current channel object while the parser executes. |
protected churchillobjects.rss4j.RssChannelImage |
currentImage
Holds the current image object while the parser executes. |
protected churchillobjects.rss4j.RssChannelItem |
currentItem
Holds the current item object while the parser executes. |
protected churchillobjects.rss4j.RssChannelTextInput |
currentTextInput
Holds the current text input object while the parser executes. |
protected churchillobjects.rss4j.RssDocument |
document
The main document object to be used as the parser runs through its events. |
protected java.util.Vector |
namespaces
Holds the namespaces that were found in the document. |
private org.xml.sax.XMLReader |
parser
The xml reader object |
Fields inherited from interface churchillobjects.rss4j.model.RssVersion |
VERSION_10, VERSION_90, VERSION_91 |
Constructor Summary | |
(package private) |
RssParser()
Blank constructor, used by the static parse methods before the version of the document is known. |
(package private) |
RssParser(churchillobjects.rss4j.RssDocument document,
java.util.Vector namespaces)
In-package constructor, used by subclasses to set their already set-up document and namespace objects. |
Method Summary | |
void |
characters(char[] ch,
int start,
int length)
SAX event. |
protected void |
cleanUp()
Releases local attributes of the parser for gc |
protected java.lang.String |
getAttribute(org.xml.sax.Attributes attrs,
java.lang.String name)
Returns the value of the attribute if it is found in the hashmap. |
protected java.lang.String |
getChars()
Returns the characters string buffer as a string, then resets it for the next element. |
protected boolean |
hasChars()
Indicates that characters are available. |
static churchillobjects.rss4j.RssDocument |
parseRss(java.io.File file)
Invokes a parse of an RSS document made available from a file object. |
(package private) churchillobjects.rss4j.RssDocument |
parseRss(org.xml.sax.InputSource is)
Starts the parsing of a document from the specified input source. |
static churchillobjects.rss4j.RssDocument |
parseRss(java.io.InputStream is)
Invokes a parse of an RSS document made available from an input stream. |
static churchillobjects.rss4j.RssDocument |
parseRss(java.io.Reader r)
Invokes a parse of an RSS document made available from a reader object. |
static churchillobjects.rss4j.RssDocument |
parseRss(java.lang.String rss)
Invokes a parse of an RSS document contained in a String as unicode text. |
protected void |
resetChars()
Resets the characters string buffer. |
void |
startElement(java.lang.String uri,
java.lang.String name,
java.lang.String qName,
org.xml.sax.Attributes atts)
SAX event. |
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
SAX event. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private org.xml.sax.XMLReader parser
protected churchillobjects.rss4j.RssDocument document
protected churchillobjects.rss4j.RssChannel currentChannel
protected churchillobjects.rss4j.RssChannelItem currentItem
protected churchillobjects.rss4j.RssChannelTextInput currentTextInput
protected churchillobjects.rss4j.RssChannelImage currentImage
private java.lang.StringBuffer characters
protected java.util.Vector namespaces
Constructor Detail |
RssParser()
RssParser(churchillobjects.rss4j.RssDocument document, java.util.Vector namespaces)
document
- namespaces
- Method Detail |
public static churchillobjects.rss4j.RssDocument parseRss(java.lang.String rss) throws RssParseException
rss
-
RssParseException
public static churchillobjects.rss4j.RssDocument parseRss(java.io.InputStream is) throws RssParseException
is
-
RssParseException
public static churchillobjects.rss4j.RssDocument parseRss(java.io.Reader r) throws RssParseException
r
-
RssParseException
public static churchillobjects.rss4j.RssDocument parseRss(java.io.File file) throws RssParseException
file
-
RssParseException
churchillobjects.rss4j.RssDocument parseRss(org.xml.sax.InputSource is) throws RssParseException
is
- The input source to parse.
RssParseException
protected void cleanUp()
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException
startPrefixMapping
in interface org.xml.sax.ContentHandler
startPrefixMapping
in class org.xml.sax.helpers.DefaultHandler
prefix
- uri
-
org.xml.sax.SAXException
public void startElement(java.lang.String uri, java.lang.String name, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
uri
- name
- qName
- atts
-
org.xml.sax.SAXException
public void characters(char[] ch, int start, int length)
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
ch
- start
- length
- protected java.lang.String getChars()
protected boolean hasChars()
protected void resetChars()
protected java.lang.String getAttribute(org.xml.sax.Attributes attrs, java.lang.String name)
attrs
- name
-
|
Copyright (c) 2000-2002 ChurchillObjects.com | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |