public class WireFeedOutput extends Object
It generates all flavors of RSS (0.90, 0.91, 0.92, 0.93, 0.94, 1.0 and 2.0) and Atom 0.3 feeds. Generators are plugable (they must implement the ModuleParser interface).
Constructor and Description |
---|
WireFeedOutput()
Creates a FeedOuput instance.
|
Modifier and Type | Method and Description |
---|---|
static List<String> |
getSupportedFeedTypes()
Returns the list of supported output feed types.
|
void |
output(WireFeed feed,
File file)
Creates a File containing with the XML representation for the given WireFeed.
|
void |
output(WireFeed feed,
File file,
boolean prettyPrint)
Creates a File containing with the XML representation for the given WireFeed.
|
void |
output(WireFeed feed,
Writer writer)
Writes to an Writer the XML representation for the given WireFeed.
|
void |
output(WireFeed feed,
Writer writer,
boolean prettyPrint)
Writes to an Writer the XML representation for the given WireFeed.
|
org.jdom2.Document |
outputJDom(WireFeed feed)
Creates a JDOM document for the given WireFeed.
|
String |
outputString(WireFeed feed)
Creates a String with the XML representation for the given WireFeed.
|
String |
outputString(WireFeed feed,
boolean prettyPrint)
Creates a String with the XML representation for the given WireFeed.
|
Document |
outputW3CDom(WireFeed feed)
Creates a W3C DOM document for the given WireFeed.
|
public static List<String> getSupportedFeedTypes()
for details on the format of these strings.
public String outputString(WireFeed feed) throws IllegalArgumentException, FeedException
If the feed encoding is not NULL, it will be used in the XML prolog encoding attribute. It is the responsibility of the developer to ensure that if the String is written to a character stream the stream charset is the same as the feed encoding property.
NOTE: This method delages to the 'Document WireFeedOutput#outputJDom(WireFeed)'.
feed
- Abstract feed to create XML representation from. The type of the WireFeed must
match the type given to the FeedOuptut constructor.IllegalArgumentException
- thrown if the feed type of the WireFeedOutput and WireFeed
don't match.FeedException
- thrown if the XML representation for the feed could not be created.public String outputString(WireFeed feed, boolean prettyPrint) throws IllegalArgumentException, FeedException
If the feed encoding is not NULL, it will be used in the XML prolog encoding attribute. It is the responsibility of the developer to ensure that if the String is written to a character stream the stream charset is the same as the feed encoding property.
NOTE: This method delages to the 'Document WireFeedOutput#outputJDom(WireFeed)'.
feed
- Abstract feed to create XML representation from. The type of the WireFeed must
match the type given to the FeedOuptut constructor.prettyPrint
- pretty-print XML (true) oder collapsedIllegalArgumentException
- thrown if the feed type of the WireFeedOutput and WireFeed
don't match.FeedException
- thrown if the XML representation for the feed could not be created.public void output(WireFeed feed, File file) throws IllegalArgumentException, IOException, FeedException
If the feed encoding is not NULL, it will be used in the XML prolog encoding attribute. The platform default charset encoding is used to write the feed to the file. It is the responsibility of the developer to ensure the feed encoding is set to the platform charset encoding.
NOTE: This method delages to the 'Document WireFeedOutput#outputJDom(WireFeed)'.
feed
- Abstract feed to create XML representation from. The type of the WireFeed must
match the type given to the FeedOuptut constructor.file
- the file where to write the XML representation for the given WireFeed.IllegalArgumentException
- thrown if the feed type of the WireFeedOutput and WireFeed
don't match.IOException
- thrown if there was some problem writing to the File.FeedException
- thrown if the XML representation for the feed could not be created.public void output(WireFeed feed, File file, boolean prettyPrint) throws IllegalArgumentException, IOException, FeedException
If the feed encoding is not NULL, it will be used in the XML prolog encoding attribute. The platform default charset encoding is used to write the feed to the file. It is the responsibility of the developer to ensure the feed encoding is set to the platform charset encoding.
NOTE: This method delages to the 'Document WireFeedOutput#outputJDom(WireFeed)'.
feed
- Abstract feed to create XML representation from. The type of the WireFeed must
match the type given to the FeedOuptut constructor.file
- the file where to write the XML representation for the given WireFeed.prettyPrint
- pretty-print XML (true) oder collapsedIllegalArgumentException
- thrown if the feed type of the WireFeedOutput and WireFeed
don't match.IOException
- thrown if there was some problem writing to the File.FeedException
- thrown if the XML representation for the feed could not be created.public void output(WireFeed feed, Writer writer) throws IllegalArgumentException, IOException, FeedException
If the feed encoding is not NULL, it will be used in the XML prolog encoding attribute. It is the responsibility of the developer to ensure the Writer instance is using the same charset encoding.
NOTE: This method delages to the 'Document WireFeedOutput#outputJDom(WireFeed)'.
feed
- Abstract feed to create XML representation from. The type of the WireFeed must
match the type given to the FeedOuptut constructor.writer
- Writer to write the XML representation for the given WireFeed.IllegalArgumentException
- thrown if the feed type of the WireFeedOutput and WireFeed
don't match.IOException
- thrown if there was some problem writing to the Writer.FeedException
- thrown if the XML representation for the feed could not be created.public void output(WireFeed feed, Writer writer, boolean prettyPrint) throws IllegalArgumentException, IOException, FeedException
If the feed encoding is not NULL, it will be used in the XML prolog encoding attribute. It is the responsibility of the developer to ensure the Writer instance is using the same charset encoding.
NOTE: This method delages to the 'Document WireFeedOutput#outputJDom(WireFeed)'.
feed
- Abstract feed to create XML representation from. The type of the WireFeed must
match the type given to the FeedOuptut constructor.writer
- Writer to write the XML representation for the given WireFeed.prettyPrint
- pretty-print XML (true) oder collapsedIllegalArgumentException
- thrown if the feed type of the WireFeedOutput and WireFeed
don't match.IOException
- thrown if there was some problem writing to the Writer.FeedException
- thrown if the XML representation for the feed could not be created.public Document outputW3CDom(WireFeed feed) throws IllegalArgumentException, FeedException
This method does not use the feed encoding property.
NOTE: This method delages to the 'Document WireFeedOutput#outputJDom(WireFeed)'.
feed
- Abstract feed to create W3C DOM document from. The type of the WireFeed must
match the type given to the FeedOuptut constructor.IllegalArgumentException
- thrown if the feed type of the WireFeedOutput and WireFeed
don't match.FeedException
- thrown if the W3C DOM document for the feed could not be created.public org.jdom2.Document outputJDom(WireFeed feed) throws IllegalArgumentException, FeedException
This method does not use the feed encoding property.
NOTE: All other output methods delegate to this method.
feed
- Abstract feed to create JDOM document from. The type of the WireFeed must match
the type given to the FeedOuptut constructor.IllegalArgumentException
- thrown if the feed type of the WireFeedOutput and WireFeed
don't match.FeedException
- thrown if the JDOM document for the feed could not be created.Copyright © 2021. All rights reserved.