|
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 | +--churchillobjects.rss4j.parser.RssParserImpl090 | +--churchillobjects.rss4j.parser.RssParserImpl100
Class to parse an RSS document according to the specifications of the RSS 1.0 standard. This object is created when the base parser already started parsing the document (and knows what the version number is), so it is given the document object and the known namespaces up to that point.
Field Summary | |
private java.util.Hashtable |
imageMappings
Maps resource strings to image objects. |
protected boolean |
inChannel
Indicates that the SAX handling process is currently in a channel. |
private boolean |
inChannelItems
Flag to indicate that channel items are being parsed. |
private boolean |
inChannelItemsSeq
Flag to indicate that we are within the item sequence. |
protected boolean |
inImage
Indicates that the SAX handling process is currently in an image. |
protected boolean |
inItem
Indicates that the SAX handling process is currently in an item. |
protected boolean |
inTextInput
Indicates that the SAX handling process is currently in a text input. |
private java.util.Hashtable |
itemMappings
Maps resource strings to item objects. |
private java.util.Hashtable |
textInputMappings
Maps resource strings to text input objects. |
private java.util.Vector |
unmappedImages
A list of image resource strings that have not yet been found in the document. |
private java.util.Vector |
unmappedItems
A list of item resource strings that have not yet been found in the document. |
private java.util.Vector |
unmappedTextInputs
A list of text input resource strings that have not yet been found in the document. |
private static java.lang.String |
VERSION
Canonical version number that is handled by this parser. |
Fields inherited from class churchillobjects.rss4j.parser.RssParser |
currentChannel, currentImage, currentItem, currentTextInput, document, namespaces |
Fields inherited from interface churchillobjects.rss4j.model.RssVersion |
VERSION_10, VERSION_90, VERSION_91 |
Constructor Summary | |
(package private) |
RssParserImpl100(churchillobjects.rss4j.RssDocument document,
java.util.Vector namespaces)
Constructor for this RSS verion's parser. |
Method Summary | |
private void |
addChannelAttribute(java.lang.String name,
java.lang.String qName)
Adds a channel attribute value from the characters buffer. |
private void |
addImageAttribute(java.lang.String name,
java.lang.String qName)
Adds an image attribute value from the characters buffer. |
private void |
addItemAttribute(java.lang.String name,
java.lang.String qName)
Adds an item attribute value from the characters buffer. |
private void |
addTextInputAttribute(java.lang.String name,
java.lang.String qName)
Adds a text input attribute value from the characters buffer. |
protected void |
checkDublinCore()
Validates that this document has specified Dublin Core in its header by examining the namespaces. |
private void |
checkForLeftovers()
Looks for any leftover items, images or textinputs from within channels that have not been 'matched' to items, images and textinputs outside the channels. |
protected void |
checkSyndication()
Validates that this document has specified Syndication in its header by examining the namespaces. |
void |
endDocument()
SAX event. |
void |
endElement(java.lang.String uri,
java.lang.String name,
java.lang.String qName)
SAX event. |
protected java.lang.String |
getAttributeUnqualified(java.lang.String element,
java.lang.String attName,
java.lang.String prefix,
org.xml.sax.Attributes attrs)
Obtains the named attribute, whether qualified or not. |
protected void |
handleChannel(java.lang.String uri,
java.lang.String name,
java.lang.String qName,
org.xml.sax.Attributes attrs)
Handles a channel element. |
protected void |
handleDublinCore(churchillobjects.rss4j.model.IUsesDublinCore dcobj,
java.lang.String name,
java.lang.String value)
Handle items that appear to be under dublin core (qualified names sstart with "dc:"). |
protected void |
handleImage(java.lang.String uri,
java.lang.String name,
java.lang.String qName,
org.xml.sax.Attributes attrs)
Handles a new image element. |
protected void |
handleItem(java.lang.String uri,
java.lang.String name,
java.lang.String qName,
org.xml.sax.Attributes attrs)
Handles an item and rdf:li element. |
protected void |
handleSyndication(churchillobjects.rss4j.model.IUsesSyndication synobj,
java.lang.String name,
java.lang.String value)
Handle items that appear to be under syndication (qualified names sstart with "sy:"). |
protected void |
handleTextInput(java.lang.String uri,
java.lang.String name,
java.lang.String qName,
org.xml.sax.Attributes attrs)
Handles a new textinput element. |
void |
startElement(java.lang.String uri,
java.lang.String name,
java.lang.String qName,
org.xml.sax.Attributes attrs)
SAX event. |
Methods inherited from class churchillobjects.rss4j.parser.RssParser |
characters, cleanUp, getAttribute, getChars, hasChars, parseRss, parseRss, parseRss, parseRss, parseRss, resetChars, startPrefixMapping |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
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 static final java.lang.String VERSION
private java.util.Hashtable itemMappings
private java.util.Hashtable imageMappings
private java.util.Hashtable textInputMappings
private java.util.Vector unmappedItems
private java.util.Vector unmappedImages
private java.util.Vector unmappedTextInputs
private boolean inChannelItems
private boolean inChannelItemsSeq
protected boolean inChannel
protected boolean inItem
protected boolean inTextInput
protected boolean inImage
Constructor Detail |
RssParserImpl100(churchillobjects.rss4j.RssDocument document, java.util.Vector namespaces)
document
- namespaces
- Method Detail |
public void startElement(java.lang.String uri, java.lang.String name, java.lang.String qName, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class RssParserImpl090
uri
- name
- qName
- attrs
-
org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String name, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class RssParserImpl090
uri
- name
- qName
-
org.xml.sax.SAXException
private void addTextInputAttribute(java.lang.String name, java.lang.String qName) throws RssParseException
name
- qName
-
RssParseException
private void addItemAttribute(java.lang.String name, java.lang.String qName) throws RssParseException
name
- qName
-
RssParseException
private void addImageAttribute(java.lang.String name, java.lang.String qName) throws RssParseException
name
- qName
-
RssParseException
private void addChannelAttribute(java.lang.String name, java.lang.String qName) throws RssParseException
name
- qName
-
RssParseException
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
protected void handleChannel(java.lang.String uri, java.lang.String name, java.lang.String qName, org.xml.sax.Attributes attrs) throws RssParseException
uri
- name
- qName
- attrs
-
RssParseException
protected void handleItem(java.lang.String uri, java.lang.String name, java.lang.String qName, org.xml.sax.Attributes attrs) throws RssParseException
uri
- name
- qName
- attrs
-
RssParseException
protected void handleTextInput(java.lang.String uri, java.lang.String name, java.lang.String qName, org.xml.sax.Attributes attrs) throws RssParseException
uri
- name
- qName
- attrs
-
RssParseException
protected void handleImage(java.lang.String uri, java.lang.String name, java.lang.String qName, org.xml.sax.Attributes attrs) throws RssParseException
uri
- name
- qName
- attrs
-
RssParseException
protected void handleSyndication(churchillobjects.rss4j.model.IUsesSyndication synobj, java.lang.String name, java.lang.String value) throws RssParseException
name
- value
-
RssParseException
protected void handleDublinCore(churchillobjects.rss4j.model.IUsesDublinCore dcobj, java.lang.String name, java.lang.String value) throws RssParseException
dcobj
- The element that uses dublin core.name
- value
-
RssParseException
protected java.lang.String getAttributeUnqualified(java.lang.String element, java.lang.String attName, java.lang.String prefix, org.xml.sax.Attributes attrs) throws RssParseException
element
- attName
- prefix
- attrs
-
RssParseException
protected void checkDublinCore() throws RssParseException
RssParseException
protected void checkSyndication() throws RssParseException
RssParseException
private void checkForLeftovers() throws RssParseException
RssParseException
|
Copyright (c) 2000-2002 ChurchillObjects.com | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |