com.sun.syndication.io
Class SyndFeedOutput

java.lang.Object
  extended by com.sun.syndication.io.SyndFeedOutput

public class SyndFeedOutput
extends Object

Generates an XML document (String, File, OutputStream, Writer, W3C DOM document or JDOM document) out of an SyndFeedImpl..

It delegates to a WireFeedOutput to generate all feed types.

Author:
Alejandro Abdelnur

Constructor Summary
SyndFeedOutput()
          Creates a SyndFeedOutput instance.
 
Method Summary
 void output(SyndFeed feed, File file)
          Creates a File containing with the XML representation for the given SyndFeedImpl.
 void output(SyndFeed feed, File file, boolean prettyPrint)
          Creates a File containing with the XML representation for the given SyndFeedImpl.
 void output(SyndFeed feed, Writer writer)
          Writes to an Writer the XML representation for the given SyndFeedImpl.
 void output(SyndFeed feed, Writer writer, boolean prettyPrint)
          Writes to an Writer the XML representation for the given SyndFeedImpl.
 org.jdom2.Document outputJDom(SyndFeed feed)
          Creates a JDOM document for the given SyndFeedImpl.
 String outputString(SyndFeed feed)
          Creates a String with the XML representation for the given SyndFeedImpl.
 String outputString(SyndFeed feed, boolean prettyPrint)
          Creates a String with the XML representation for the given SyndFeedImpl.
 Document outputW3CDom(SyndFeed feed)
          Creates a W3C DOM document for the given SyndFeedImpl.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyndFeedOutput

public SyndFeedOutput()
Creates a SyndFeedOutput instance.

Method Detail

outputString

public String outputString(SyndFeed feed)
                    throws FeedException
Creates a String with the XML representation for the given SyndFeedImpl.

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.

Parameters:
feed - Abstract feed to create XML representation from. The type of the SyndFeedImpl must match the type given to the FeedOuptut constructor.
Returns:
a String with the XML representation for the given SyndFeedImpl.
Throws:
FeedException - thrown if the XML representation for the feed could not be created.

outputString

public String outputString(SyndFeed feed,
                           boolean prettyPrint)
                    throws FeedException
Creates a String with the XML representation for the given SyndFeedImpl.

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.

Parameters:
feed - Abstract feed to create XML representation from. The type of the SyndFeedImpl must match the type given to the FeedOuptut constructor.
prettyPrint - pretty-print XML (true) oder collapsed
Returns:
a String with the XML representation for the given SyndFeedImpl.
Throws:
FeedException - thrown if the XML representation for the feed could not be created.

output

public void output(SyndFeed feed,
                   File file)
            throws IOException,
                   FeedException
Creates a File containing with the XML representation for the given SyndFeedImpl.

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.

Parameters:
feed - Abstract feed to create XML representation from. The type of the SyndFeedImpl must match the type given to the FeedOuptut constructor.
file - the file where to write the XML representation for the given SyndFeedImpl.
Throws:
IOException - thrown if there was some problem writing to the File.
FeedException - thrown if the XML representation for the feed could not be created.

output

public void output(SyndFeed feed,
                   File file,
                   boolean prettyPrint)
            throws IOException,
                   FeedException
Creates a File containing with the XML representation for the given SyndFeedImpl.

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.

Parameters:
feed - Abstract feed to create XML representation from. The type of the SyndFeedImpl must match the type given to the FeedOuptut constructor.
prettyPrint - pretty-print XML (true) oder collapsed
file - the file where to write the XML representation for the given SyndFeedImpl.
Throws:
IOException - thrown if there was some problem writing to the File.
FeedException - thrown if the XML representation for the feed could not be created.

output

public void output(SyndFeed feed,
                   Writer writer)
            throws IOException,
                   FeedException
Writes to an Writer the XML representation for the given SyndFeedImpl.

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.

Parameters:
feed - Abstract feed to create XML representation from. The type of the SyndFeedImpl must match the type given to the FeedOuptut constructor.
writer - Writer to write the XML representation for the given SyndFeedImpl.
Throws:
IOException - thrown if there was some problem writing to the Writer.
FeedException - thrown if the XML representation for the feed could not be created.

output

public void output(SyndFeed feed,
                   Writer writer,
                   boolean prettyPrint)
            throws IOException,
                   FeedException
Writes to an Writer the XML representation for the given SyndFeedImpl.

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.

Parameters:
feed - Abstract feed to create XML representation from. The type of the SyndFeedImpl must match the type given to the FeedOuptut constructor.
prettyPrint - pretty-print XML (true) oder collapsed
writer - Writer to write the XML representation for the given SyndFeedImpl.
Throws:
IOException - thrown if there was some problem writing to the Writer.
FeedException - thrown if the XML representation for the feed could not be created.

outputW3CDom

public Document outputW3CDom(SyndFeed feed)
                      throws FeedException
Creates a W3C DOM document for the given SyndFeedImpl.

This method does not use the feed encoding property.

Parameters:
feed - Abstract feed to create W3C DOM document from. The type of the SyndFeedImpl must match the type given to the FeedOuptut constructor.
Returns:
the W3C DOM document for the given SyndFeedImpl.
Throws:
FeedException - thrown if the W3C DOM document for the feed could not be created.

outputJDom

public org.jdom2.Document outputJDom(SyndFeed feed)
                              throws FeedException
Creates a JDOM document for the given SyndFeedImpl.

This method does not use the feed encoding property.

Parameters:
feed - Abstract feed to create JDOM document from. The type of the SyndFeedImpl must match the type given to the FeedOuptut constructor.
Returns:
the JDOM document for the given SyndFeedImpl.
Throws:
FeedException - thrown if the JDOM document for the feed could not be created.


Copyright © 2004–2013 ROME Project. All rights reserved.