public class SyndFeedInput extends Object
It delegates to a WireFeedInput to handle all feed types.
Constructor and Description |
---|
SyndFeedInput()
Creates a SyndFeedInput instance with input validation turned off.
|
SyndFeedInput(boolean validate,
Locale locale)
Creates a SyndFeedInput instance.
|
Modifier and Type | Method and Description |
---|---|
SyndFeed |
build(Document document)
Builds SyndFeedImpl from an W3C DOM document.
|
SyndFeed |
build(org.jdom2.Document document)
Builds SyndFeedImpl from an JDOM document.
|
SyndFeed |
build(File file)
Builds SyndFeedImpl from a file.
|
SyndFeed |
build(InputSource is)
Builds SyndFeedImpl from an W3C SAX InputSource.
|
SyndFeed |
build(Reader reader)
Builds SyndFeedImpl from an Reader.
|
boolean |
getXmlHealerOn()
Indicates if the WiredFeedInput instance will XML heal (if necessary) the character stream.
|
boolean |
isAllowDoctypes()
Indicates whether Doctype declarations are allowed.
|
boolean |
isPreserveWireFeed() |
void |
setAllowDoctypes(boolean allowDoctypes)
Since ROME 1.5.1 we fixed a security vulnerability by disallowing Doctype declarations by default.
|
void |
setPreserveWireFeed(boolean preserveWireFeed) |
void |
setXmlHealerOn(boolean heals)
Enables XML healing in the WiredFeedInput instance.
|
public SyndFeedInput()
public SyndFeedInput(boolean validate, Locale locale)
validate
- indicates if the input should be validated. NOT IMPLEMENTED YET (validation
does not happen)public void setXmlHealerOn(boolean heals)
Healing trims leading chars from the stream (empty spaces and comments) until the XML prolog.
Healing resolves HTML entities (from literal to code number) in the reader.
The healing is done only with the build(File) and build(Reader) signatures.
By default is TRUE.
heals
- TRUE enables stream healing, FALSE disables it.public boolean getXmlHealerOn()
Healing trims leading chars from the stream (empty spaces and comments) until the XML prolog.
Healing resolves HTML entities (from literal to code number) in the reader.
The healing is done only with the build(File) and build(Reader) signatures.
By default is TRUE.
public boolean isAllowDoctypes()
public void setAllowDoctypes(boolean allowDoctypes)
allowDoctypes
- true when Doctype declarations should be allowed again, false otherwisepublic SyndFeed build(File file) throws FileNotFoundException, IOException, IllegalArgumentException, FeedException
file
- file to read to create the SyndFeedImpl.FileNotFoundException
- thrown if the file could not be found.IOException
- thrown if there is problem reading the file.IllegalArgumentException
- thrown if feed type could not be understood by any of the
underlying parsers.FeedException
- if the feed could not be parsedpublic SyndFeed build(Reader reader) throws IllegalArgumentException, FeedException
reader
- Reader to read to create the SyndFeedImpl.IllegalArgumentException
- thrown if feed type could not be understood by any of the
underlying parsers.FeedException
- if the feed could not be parsedpublic SyndFeed build(InputSource is) throws IllegalArgumentException, FeedException
is
- W3C SAX InputSource to read to create the SyndFeedImpl.IllegalArgumentException
- thrown if feed type could not be understood by any of the
underlying parsers.FeedException
- if the feed could not be parsedpublic SyndFeed build(Document document) throws IllegalArgumentException, FeedException
document
- W3C DOM document to read to create the SyndFeedImpl.IllegalArgumentException
- thrown if feed type could not be understood by any of the
underlying parsers.FeedException
- if the feed could not be parsedpublic SyndFeed build(org.jdom2.Document document) throws IllegalArgumentException, FeedException
document
- JDOM document to read to create the SyndFeedImpl.IllegalArgumentException
- thrown if feed type could not be understood by any of the
underlying parsers.FeedException
- if the feed could not be parsedpublic boolean isPreserveWireFeed()
public void setPreserveWireFeed(boolean preserveWireFeed)
preserveWireFeed
- set to true to make the WireFeed is made available in the SyndFeed.
False by default.Copyright © 2018. All rights reserved.