It accepts all flavors of RSS (0.90, 0.91, 0.92, 0.93, 0.94, 1.0 and 2.0) and Atom 0.3 feeds. Parsers are plugable (they must implement the WireFeedParser interface).
The WireFeedInput useds liberal parsers.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private static Map | |
| private static final InputSource | |
| private final Locale | |
| private static final EntityResolver | |
| private final boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | WireFeedInput(final boolean
indicates if the input should be validated. NOT IMPLEMENTED YET (validation
does not happen) validate, final Locale locale)Creates a WireFeedInput instance. |
| Modifier and Type | Method and Description |
|---|---|
| public WireFeed | |
| public WireFeed | |
| public WireFeed | Returns: the WireFeed read from the W3C SAX InputSource.W3C SAX InputSource to read to create the WireFeed. is)Builds an WireFeed (RSS or Atom) from an W3C SAX InputSource. |
| public WireFeed | |
| public WireFeed | |
| protected SAXBuilder | Returns: a new org.jdom2.input.SAXBuilder objectCreates and sets up a org.jdom2.input.SAXBuilder for parsing. |
| private static FeedParsers | |
| public static List | Returns: a list of String elements with the supported input feed types.Returns the list of supported input feed types. |
| public boolean | Returns: TRUE if healing is enabled, FALSE if not.Indicates if the WiredFeedInput instance will XML heal (if necessary) the character stream. |
| public boolean | Returns: true when Doctype declarations are allowed, false otherwiseIndicates whether Doctype declarations are allowed. |
| private boolean | |
| public void | setAllowDoctypes(boolean
true when Doctype declarations should be allowed again, false otherwise allowDoctypes)Since ROME 1.5.1 we fixed a security vulnerability by disallowing Doctype declarations by default. |
| private void | |
| public void | setXmlHealerOn(final boolean
TRUE enables stream healing, FALSE disables it. heals)Enables XML healing in the WiredFeedInput instance. |
| allowDoctypes | back to summary |
|---|---|
| private boolean allowDoctypes | |
| clMap | back to summary |
|---|---|
| private static Map<ClassLoader, FeedParsers> clMap | |
| EMPTY_INPUTSOURCE | back to summary |
|---|---|
| private static final InputSource EMPTY_INPUTSOURCE | |
| locale | back to summary |
|---|---|
| private final Locale locale | |
| RESOLVER | back to summary |
|---|---|
| private static final EntityResolver RESOLVER | |
| validate | back to summary |
|---|---|
| private final boolean validate | |
| xmlHealerOn | back to summary |
|---|---|
| private boolean xmlHealerOn | |
| WireFeedInput | back to summary |
|---|---|
| public WireFeedInput() Creates a WireFeedInput instance with input validation turned off.
| |
| WireFeedInput | back to summary |
|---|---|
| public WireFeedInput(final boolean validate, final Locale locale) Creates a WireFeedInput instance.
| |
| build | back to summary |
|---|---|
| public WireFeed build(final File file) throws FileNotFoundException, IOException, IllegalArgumentException, FeedException Builds an WireFeed (RSS or Atom) from a file. Note This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'.
| |
| build | back to summary |
|---|---|
| public WireFeed build(Reader reader) throws IllegalArgumentException, FeedException Builds an WireFeed (RSS or Atom) from an Reader. Note This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'.
| |
| build | back to summary |
|---|---|
| public WireFeed build(final InputSource is) throws IllegalArgumentException, FeedException Builds an WireFeed (RSS or Atom) from an W3C SAX InputSource. Note This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'.
| |
| build | back to summary |
|---|---|
| public WireFeed build(final Document document) throws IllegalArgumentException, FeedException Builds an WireFeed (RSS or Atom) from an W3C DOM document. Note This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'.
| |
| build | back to summary |
|---|---|
| public WireFeed build(final Document document) throws IllegalArgumentException, FeedException Builds an WireFeed (RSS or Atom) from an JDOM document. Note All other build methods delegate to this method.
| |
| createSAXBuilder | back to summary |
|---|---|
| protected SAXBuilder createSAXBuilder() Creates and sets up a org.jdom2.input.SAXBuilder for parsing.
| |
| getFeedParsers | back to summary |
|---|---|
| private static FeedParsers getFeedParsers() | |
| getSupportedFeedTypes | back to summary |
|---|---|
| public static List Returns the list of supported input feed types.
| |
| getXmlHealerOn | back to summary |
|---|---|
| public boolean getXmlHealerOn() Indicates if the WiredFeedInput instance will XML heal (if necessary) the character stream. 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.
| |
| isAllowDoctypes | back to summary |
|---|---|
| public boolean isAllowDoctypes() Indicates whether Doctype declarations are allowed.
| |
| isFeatureSupported | back to summary |
|---|---|
| private boolean isFeatureSupported(XMLReader parser, String feature, boolean value) | |
| setAllowDoctypes | back to summary |
|---|---|
| public void setAllowDoctypes(boolean allowDoctypes) Since ROME 1.5.1 we fixed a security vulnerability by disallowing Doctype declarations by default. This change breaks the compatibility with at least RSS 0.91N because it requires a Doctype declaration. You are able to allow Doctype declarations again with this property. You should only activate it when the feeds that you process are absolutely trustful.
| |
| setFeature | back to summary |
|---|---|
| private void setFeature(SAXBuilder saxBuilder, XMLReader parser, String feature, boolean value) | |
| setXmlHealerOn | back to summary |
|---|---|
| public void setXmlHealerOn(final boolean heals) Enables XML healing in the WiredFeedInput instance. 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.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public InputSource | resolveEntity(final String
The public identifier of the external entity
being referenced, or null if none was supplied. publicId, final String The system identifier of the external entity
being referenced. systemId)Implements org. |
| EmptyEntityResolver | back to summary |
|---|---|
| private EmptyEntityResolver() | |
| resolveEntity | back to summary |
|---|---|
| public InputSource resolveEntity(final String publicId, final String systemId) Implements org. Doc from org. Allow the application to resolve external entities. The parser will call this method before opening any external entity except the top-level document entity. Such entities include the external DTD subset and external parameter entities referenced within the DTD (in either case, only if the parser reads external parameter entities), and external general entities referenced within the document element (if the parser reads external general entities). The application may request that the parser locate the entity itself, that it use an alternative URI, or that it use data provided by the application (as a character or byte input stream). Application writers can use this method to redirect external system identifiers to secure and/or local URIs, to look up public identifiers in a catalogue, or to read an entity from a database or other input source (including, for example, a dialog box). Neither XML nor SAX specifies a preferred policy for using public or system IDs to resolve resources. However, SAX specifies how to interpret any InputSource returned by this method, and that if none is returned, then the system ID will be dereferenced as a URL. If the system identifier is a URL, the SAX parser must resolve it fully before reporting it to the application.
| |