Top Description Fields Constructors Methods
com.rometools.rome.io

public Class WireFeedOutput

extends Object
Class Inheritance
Imports
java.io.File, .FileWriter, .IOException, .Writer, java.util.LinkedHashMap, .List, .Map, .WeakHashMap, org.jdom2.Document, .JDOMException, .ProcessingInstruction, org.jdom2.output.DOMOutputter, .Format, .XMLOutputter, com.rometools.rome.feed.WireFeed, com.rometools.rome.feed.impl.ConfigurableClassLoader, com.rometools.rome.io.impl.FeedGenerators

Generates an XML document (String, File, OutputStream, Writer, W3C DOM document or JDOM document) out of an WireFeed (RSS/Atom).

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).

Field Summary

Modifier and TypeField and Description
private static Map<ClassLoader, FeedGenerators>

Constructor Summary

AccessConstructor and Description
public
WireFeedOutput()

Creates a FeedOuput instance.

Method Summary

Modifier and TypeMethod and Description
private static FeedGenerators
public static List<String>

Returns:

a list of String elements with the supported output feed types.
getSupportedFeedTypes
()

Returns the list of supported output feed types.

public void
output(final WireFeed
Abstract feed to create XML representation from. The type of the WireFeed must match the type given to the FeedOuptut constructor.
feed
,
final File
the file where to write the XML representation for the given WireFeed.
file
)

Creates a File containing with the XML representation for the given WireFeed.

public void
output(final WireFeed
Abstract feed to create XML representation from. The type of the WireFeed must match the type given to the FeedOuptut constructor.
feed
,
final File
the file where to write the XML representation for the given WireFeed.
file
,
final boolean
pretty-print XML (true) oder collapsed
prettyPrint
)

Creates a File containing with the XML representation for the given WireFeed.

public void
output(final WireFeed
Abstract feed to create XML representation from. The type of the WireFeed must match the type given to the FeedOuptut constructor.
feed
,
final Writer
Writer to write the XML representation for the given WireFeed.
writer
)

Writes to an Writer the XML representation for the given WireFeed.

public void
output(final WireFeed
Abstract feed to create XML representation from. The type of the WireFeed must match the type given to the FeedOuptut constructor.
feed
,
final Writer
Writer to write the XML representation for the given WireFeed.
writer
,
final boolean
pretty-print XML (true) oder collapsed
prettyPrint
)

Writes to an Writer the XML representation for the given WireFeed.

public Document

Returns:

the JDOM document for the given WireFeed.
outputJDom
(final WireFeed
Abstract feed to create JDOM document from. The type of the WireFeed must match the type given to the FeedOuptut constructor.
feed
)

Creates a JDOM document for the given WireFeed.

public String

Returns:

a String with the XML representation for the given WireFeed.
outputString
(final WireFeed
Abstract feed to create XML representation from. The type of the WireFeed must match the type given to the FeedOuptut constructor.
feed
)

Creates a String with the XML representation for the given WireFeed.

public String

Returns:

a String with the XML representation for the given WireFeed.
outputString
(final WireFeed
Abstract feed to create XML representation from. The type of the WireFeed must match the type given to the FeedOuptut constructor.
feed
,
final boolean
pretty-print XML (true) oder collapsed
prettyPrint
)

Creates a String with the XML representation for the given WireFeed.

public Document

Returns:

the W3C DOM document for the given WireFeed.
outputW3CDom
(final WireFeed
Abstract feed to create W3C DOM document from. The type of the WireFeed must match the type given to the FeedOuptut constructor.
feed
)

Creates a W3C DOM document for the given WireFeed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clMapback to summary
private static Map<ClassLoader, FeedGenerators> clMap

Constructor Detail

WireFeedOutputback to summary
public WireFeedOutput()

Creates a FeedOuput instance.

Method Detail

getFeedGeneratorsback to summary
private static FeedGenerators getFeedGenerators()
getSupportedFeedTypesback to summary
public static List<String> getSupportedFeedTypes()

Returns the list of supported output feed types.

Returns:List<String>

a list of String elements with the supported output feed types.

See Also
{@link WireFeed} for details on the format of these strings.

outputback to summary
public void output(final WireFeed feed, final File file) throws IllegalArgumentException, IOException, FeedException

Creates a File containing with the XML representation for the given WireFeed.

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)'.

Parameters
feed:WireFeed

Abstract feed to create XML representation from. The type of the WireFeed must match the type given to the FeedOuptut constructor.

file:File

the file where to write the XML representation for the given WireFeed.

Exceptions
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.
outputback to summary
public void output(final WireFeed feed, final File file, final boolean prettyPrint) throws IllegalArgumentException, IOException, FeedException

Creates a File containing with the XML representation for the given WireFeed.

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)'.

Parameters
feed:WireFeed

Abstract feed to create XML representation from. The type of the WireFeed must match the type given to the FeedOuptut constructor.

file:File

the file where to write the XML representation for the given WireFeed.

prettyPrint:boolean

pretty-print XML (true) oder collapsed

Exceptions
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.
outputback to summary
public void output(final WireFeed feed, final Writer writer) throws IllegalArgumentException, IOException, FeedException

Writes to an Writer the XML representation for the given WireFeed.

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)'.

Parameters
feed:WireFeed

Abstract feed to create XML representation from. The type of the WireFeed must match the type given to the FeedOuptut constructor.

writer:Writer

Writer to write the XML representation for the given WireFeed.

Exceptions
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.
outputback to summary
public void output(final WireFeed feed, final Writer writer, final boolean prettyPrint) throws IllegalArgumentException, IOException, FeedException

Writes to an Writer the XML representation for the given WireFeed.

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)'.

Parameters
feed:WireFeed

Abstract feed to create XML representation from. The type of the WireFeed must match the type given to the FeedOuptut constructor.

writer:Writer

Writer to write the XML representation for the given WireFeed.

prettyPrint:boolean

pretty-print XML (true) oder collapsed

Exceptions
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.
outputJDomback to summary
public Document outputJDom(final WireFeed feed) throws IllegalArgumentException, FeedException

Creates a JDOM document for the given WireFeed.

This method does not use the feed encoding property.

Note

All other output methods delegate to this method.

Parameters
feed:WireFeed

Abstract feed to create JDOM document from. The type of the WireFeed must match the type given to the FeedOuptut constructor.

Returns:Document

the JDOM document for the given WireFeed.

Exceptions
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.
outputStringback to summary
public String outputString(final WireFeed feed) throws IllegalArgumentException, FeedException

Creates a String with the XML representation for the given WireFeed.

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)'.

Parameters
feed:WireFeed

Abstract feed to create XML representation from. The type of the WireFeed must match the type given to the FeedOuptut constructor.

Returns:String

a String with the XML representation for the given WireFeed.

Exceptions
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.
outputStringback to summary
public String outputString(final WireFeed feed, final boolean prettyPrint) throws IllegalArgumentException, FeedException

Creates a String with the XML representation for the given WireFeed.

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)'.

Parameters
feed:WireFeed

Abstract feed to create XML representation from. The type of the WireFeed must match the type given to the FeedOuptut constructor.

prettyPrint:boolean

pretty-print XML (true) oder collapsed

Returns:String

a String with the XML representation for the given WireFeed.

Exceptions
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.
outputW3CDomback to summary
public Document outputW3CDom(final WireFeed feed) throws IllegalArgumentException, FeedException

Creates a W3C DOM document for the given WireFeed.

This method does not use the feed encoding property.

Note

This method delages to the 'Document WireFeedOutput#outputJDom(WireFeed)'.

Parameters
feed:WireFeed

Abstract feed to create W3C DOM document from. The type of the WireFeed must match the type given to the FeedOuptut constructor.

Returns:Document

the W3C DOM document for the given WireFeed.

Exceptions
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.