Package net.i2p.router.news
Class NewsXMLParser
java.lang.Object
net.i2p.router.news.NewsXMLParser
Parse out the news.xml file which is in Atom format (RFC4287).
We use the XML parser from the UPnP library.
- Since:
- 0.9.17
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The action taken when encountering a non-whitelisted XHTML element or blacklisted attribute in the feed content. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe blocklist entries.The news CRL entries.The news entries.The news metatdata.Helper to get all Nodes matching the namestatic void
Process the XML file.parse
(InputStream in) Process the XML input stream.void
Sets the action taken when encountering a non-whitelisted XHTML element in the feed content.
-
Constructor Details
-
NewsXMLParser
-
-
Method Details
-
setXHTMLMode
Sets the action taken when encountering a non-whitelisted XHTML element in the feed content. Must be set before parse(). Default REMOVE_ELEMENT. -
parse
Process the XML file.- Parameters:
file
- XML content only. Any su3 or gunzip handling must have already happened.- Returns:
- the root node
- Throws:
IOException
- on any parse error
-
parse
Process the XML input stream.- Parameters:
in
- XML content only. Any su3 or gunzip handling must have already happened.- Returns:
- the root node
- Throws:
IOException
- on any parse error
-
getEntries
The news entries. Must call parse() first.- Returns:
- sorted, newest first, null if parse failed
-
getMetadata
The news metatdata. Must call parse() first.- Returns:
- null if parse failed
-
getCRLEntries
The news CRL entries. Must call parse() first.- Returns:
- unsorted, null if none
- Since:
- 0.9.26
-
getBlocklistEntries
The blocklist entries. Must call parse() first.- Returns:
- null if none
- Since:
- 0.9.28
-
getNodes
Helper to get all Nodes matching the name- Returns:
- non-null
-
main
-