public class RssDocReader extends java.lang.Object implements FormatReader<DocData>
| Constructor and Description |
|---|
RssDocReader()
Create a new RssDocReader.
|
RssDocReader(FormatReader<RssItem> rssReader)
Create a new RssDocReader that reads RSS items from the RssReader
|
RssDocReader(java.lang.String urlStr)
Create a new RssDocReader, reading from the specified URL.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead()
Return whether this reader is in a state where it can attempt to read
data.
|
void |
close()
close this reader
|
protected DocData |
convertUrl(java.net.URL url)
Convert a webpage, specified by URL, into a DocData object
|
java.lang.String |
getFilters()
Get the filters for this reader.
|
java.lang.String |
getSource()
Get the source for this reader
|
boolean |
hasMoreData()
Returns whether the reader has more data to read.
|
java.util.List<DocData> |
readData()
Read data from the underlying RssReader.
|
void |
setFilters(java.lang.String filters)
Set filters for this reader
|
void |
setSource(java.lang.String source)
Set the source for this FormatReader.
|
java.lang.String |
toString()
Return a String representation of this reader
|
public RssDocReader()
setSource() method.public RssDocReader(FormatReader<RssItem> rssReader)
rssReader - The RssReaderpublic RssDocReader(java.lang.String urlStr)
throws java.io.IOException,
org.xml.sax.SAXException
urlStr - the RSS feed URL stringjava.io.IOException - if there is a problem opening a connection to the
streamorg.xml.sax.SAXException - if there is a problem reading the data from the
streampublic boolean canRead()
canRead in interface FormatReader<DocData>public void close()
close in interface FormatReader<DocData>protected DocData convertUrl(java.net.URL url)
url - the URLpublic java.lang.String getFilters()
getFilters in interface FormatReader<DocData>public java.lang.String getSource()
getSource in interface FormatReader<DocData>public boolean hasMoreData()
hasMoreData in interface FormatReader<DocData>public java.util.List<DocData> readData()
readData in interface FormatReader<DocData>public void setFilters(java.lang.String filters)
setFilters in interface FormatReader<DocData>filters - the filters for this readerpublic void setSource(java.lang.String source)
setSource in interface FormatReader<DocData>source - the source for this reader. The source should be the URL
for an RSS feedpublic java.lang.String toString()
toString in class java.lang.Object