org.restlet.ext.rome
Class SyndFeedRepresentation

java.lang.Object
  extended by org.restlet.representation.Variant
      extended by org.restlet.representation.RepresentationInfo
          extended by org.restlet.representation.Representation
              extended by org.restlet.representation.CharacterRepresentation
                  extended by org.restlet.representation.WriterRepresentation
                      extended by org.restlet.ext.rome.SyndFeedRepresentation

public class SyndFeedRepresentation
extends WriterRepresentation

A syndicated feed representation (such as RSS or Atom) based on the ROME library. Add feed entries to SyndFeed.getEntries(), which you can access via getFeed().

Author:
Tal Liron
See Also:
ROME home

Field Summary
 
Fields inherited from class org.restlet.representation.Representation
UNKNOWN_SIZE
 
Constructor Summary
SyndFeedRepresentation()
          Constructs a UTF8 RSS 2.0 feed.
SyndFeedRepresentation(Representation feedRepresentation)
          Constructor that parses the given feed representation.
SyndFeedRepresentation(String feedType)
          Constructs a UTF8 feed.
SyndFeedRepresentation(String feedType, CharacterSet characterSet)
          Constructs a feed.
SyndFeedRepresentation(String feedType, List<?> entries, CharacterSet characterSet)
          Constructs a feed.
SyndFeedRepresentation(com.sun.syndication.feed.synd.SyndFeed feed)
          Constructor around an existing feed.
 
Method Summary
 com.sun.syndication.feed.synd.SyndFeed getFeed()
          The wrapped feed.
static MediaType getMediaType(String feedType)
          Converts a feed type to a media type.
 void write(Writer writer)
           
 
Methods inherited from class org.restlet.representation.WriterRepresentation
getReader
 
Methods inherited from class org.restlet.representation.CharacterRepresentation
getChannel, getStream, write, write
 
Methods inherited from class org.restlet.representation.Representation
append, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, getText, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, release, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransient
 
Methods inherited from class org.restlet.representation.RepresentationInfo
getModificationDate, getTag, setModificationDate, setTag
 
Methods inherited from class org.restlet.representation.Variant
createClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SyndFeedRepresentation

public SyndFeedRepresentation()
Constructs a UTF8 RSS 2.0 feed.


SyndFeedRepresentation

public SyndFeedRepresentation(Representation feedRepresentation)
                       throws IOException
Constructor that parses the given feed representation.

Parameters:
feedRepresentation - The feed representation to parse.
Throws:
IOException

SyndFeedRepresentation

public SyndFeedRepresentation(String feedType)
Constructs a UTF8 feed.

Parameters:
feedType - The feed type (see ROME documentation)

SyndFeedRepresentation

public SyndFeedRepresentation(String feedType,
                              CharacterSet characterSet)
Constructs a feed.

Parameters:
feedType - The feed type (see ROME documentation)
characterSet - The character set

SyndFeedRepresentation

public SyndFeedRepresentation(String feedType,
                              List<?> entries,
                              CharacterSet characterSet)
Constructs a feed.

Parameters:
feedType - The feed type (see ROME documentation)
entries - The list of entries
characterSet - The character set

SyndFeedRepresentation

public SyndFeedRepresentation(com.sun.syndication.feed.synd.SyndFeed feed)
Constructor around an existing feed.

Parameters:
feed - The feed (must have a valid feedType!)
Method Detail

getMediaType

public static MediaType getMediaType(String feedType)
Converts a feed type to a media type.

Parameters:
feedType - The source feed type.
Returns:
The result media type or null.

getFeed

public com.sun.syndication.feed.synd.SyndFeed getFeed()
The wrapped feed.

Returns:
The feed

write

public void write(Writer writer)
           throws IOException
Specified by:
write in class Representation
Throws:
IOException


Copyright © 2005-2013 Restlet.