public class NewsXMLParser extends Object
Modifier and Type | Class and Description |
---|---|
static class |
NewsXMLParser.XHTMLMode
The action taken when encountering a non-whitelisted
XHTML element or blacklisted attribute in the feed content.
|
Constructor and Description |
---|
NewsXMLParser(I2PAppContext ctx) |
Modifier and Type | Method and Description |
---|---|
BlocklistEntries |
getBlocklistEntries()
The blocklist entries.
|
List<CRLEntry> |
getCRLEntries()
The news CRL entries.
|
List<NewsEntry> |
getEntries()
The news entries.
|
NewsMetadata |
getMetadata()
The news metatdata.
|
static List<Node> |
getNodes(Node node,
String name)
Helper to get all Nodes matching the name
|
static void |
main(String[] args) |
Node |
parse(File file)
Process the XML file.
|
Node |
parse(InputStream in)
Process the XML input stream.
|
void |
setXHTMLMode(NewsXMLParser.XHTMLMode mode)
Sets the action taken when encountering a non-whitelisted
XHTML element in the feed content.
|
public NewsXMLParser(I2PAppContext ctx)
public void setXHTMLMode(NewsXMLParser.XHTMLMode mode)
public Node parse(File file) throws IOException
file
- XML content only. Any su3 or gunzip handling must have
already happened.IOException
- on any parse errorpublic Node parse(InputStream in) throws IOException
in
- XML content only. Any su3 or gunzip handling must have
already happened.IOException
- on any parse errorpublic List<NewsEntry> getEntries()
public NewsMetadata getMetadata()
public List<CRLEntry> getCRLEntries()
public BlocklistEntries getBlocklistEntries()
public static List<Node> getNodes(Node node, String name)
public static void main(String[] args)