|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.nava.informa.parsers.FeedParser
public class FeedParser
Parser class which allows reading in of RSS news channels. The concrete rules how the XML elements map to our channel object model are delegated to version specific private classes.
Currently the FeedParser support RSS formats 0.9x, 1.0 (RDF), 2.0 and Atom 0.3. It's possible to specify class of custom XML parser to use instead of standard Crimson parser (JDK). UsesetSaxDriverClassName()
method
for that.
Constructor Summary | |
---|---|
FeedParser()
|
Method Summary | |
---|---|
static void |
main(String[] args)
|
static ChannelIF |
parse(ChannelBuilderIF cBuilder,
File aFile)
Parse feed presented by file and build channel. |
static ChannelIF |
parse(ChannelBuilderIF cBuilder,
InputSource inpSource,
URL baseLocation)
Parse feed from input source with base location set and create channel. |
static ChannelIF |
parse(ChannelBuilderIF cBuilder,
InputStream stream)
Parse feed presented by InputStream and build channel. |
static ChannelIF |
parse(ChannelBuilderIF cBuilder,
Reader reader)
Parse feed presented by Reader and build channel. |
static ChannelIF |
parse(ChannelBuilderIF cBuilder,
String url)
Parser feed behind the given URL and build channel. |
static ChannelIF |
parse(ChannelBuilderIF cBuilder,
URL aURL)
Parser feed behind the given URL and build channel. |
static void |
setSaxDriverClassName(String className)
Sets the name of SAX2 Driver class to use for parsing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FeedParser()
Method Detail |
---|
public static void setSaxDriverClassName(String className) throws ClassNotFoundException
className
- name of SAX2 Driver class.
ClassNotFoundException
- if class isn't found in the class path.
ClassCastException
- if class isn't implementing XMLReader interface.public static ChannelIF parse(ChannelBuilderIF cBuilder, String url) throws IOException, ParseException
cBuilder
- specific channel builder to use.url
- URL to use as data source.
IOException
- if IO errors occur.
ParseException
- if parsing is not possible.public static ChannelIF parse(ChannelBuilderIF cBuilder, URL aURL) throws IOException, ParseException
cBuilder
- specific channel builder to use.aURL
- URL to use as data source.
IOException
- if IO errors occur.
ParseException
- if parsing is not possible.public static ChannelIF parse(ChannelBuilderIF cBuilder, Reader reader) throws IOException, ParseException
cBuilder
- specific channel builder to use.reader
- reader setup to read feed data.
IOException
- if IO errors occur.
ParseException
- if parsing is not possible.public static ChannelIF parse(ChannelBuilderIF cBuilder, InputStream stream) throws IOException, ParseException
cBuilder
- specific channel builder to use.stream
- stream setup to read feed data.
IOException
- if IO errors occur.
ParseException
- if parsing is not possible.public static ChannelIF parse(ChannelBuilderIF cBuilder, File aFile) throws IOException, ParseException
cBuilder
- specific channel builder to use.aFile
- file to read data from.
IOException
- if IO errors occur.
ParseException
- if parsing is not possible.public static ChannelIF parse(ChannelBuilderIF cBuilder, InputSource inpSource, URL baseLocation) throws IOException, ParseException
cBuilder
- specific channel builder to use.inpSource
- input source of data.baseLocation
- base location of feed.
IOException
- if IO errors occur.
ParseException
- if parsing is not possible.public static void main(String[] args) throws IOException, ParseException
IOException
ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |