Lizzy v1.1.1

christophedelory.playlist
Interface SpecificPlaylistProvider

All Known Implementing Classes:
AsxProvider, AtomProvider, B4sProvider, HypetapeProvider, KplProvider, M3UProvider, MPCPLProvider, PLAProvider, PlistProvider, PLPProvider, PLSProvider, RmpProvider, RSSProvider, SmilProvider, WplProvider, XspfProvider

public interface SpecificPlaylistProvider

A specific playlist provider manages a given type of playlist (for example ASX or M3U). Concrete classes must have a zero-argument constructor so that they can be instantiated during loading.

Version:
$Revision: 92 $
Author:
Christophe Delory

Method Summary
 ContentType[] getContentTypes()
          Returns a list of one or more content types representing the playlists compatible with this provider.
 String getId()
          Returns a unique string identifying the type of specific playlists handled by this provider.
 SpecificPlaylist readFrom(InputStream in, String encoding, Log logger)
          Reads a playlist from the specified input stream.
 SpecificPlaylist toSpecificPlaylist(Playlist playlist)
          Builds a specific representation of the given generic playlist.
 

Method Detail

getId

String getId()
Returns a unique string identifying the type of specific playlists handled by this provider.

Returns:
a playlist identifier. Shall not be null.

getContentTypes

ContentType[] getContentTypes()
Returns a list of one or more content types representing the playlists compatible with this provider. The list should be ordered from the most used / recommended to the least one.

Returns:
a list of content types. Shall not be null nor empty.

readFrom

SpecificPlaylist readFrom(InputStream in,
                          String encoding,
                          Log logger)
                          throws Exception
Reads a playlist from the specified input stream. When done, the stream remains open.

Parameters:
in - an input stream. Shall not be null.
encoding - the content encoding of the input resource, or null if not known.
logger - the logger that may be used during the unmarshalling process, if needed. Shall not be null.
Returns:
a new playlist instance, or null if the format has been recognized, but the playlist is malformed.
Throws:
NullPointerException - if in is null.
NullPointerException - if logger is null.
Exception - if any error occurs during the unmarshalling process.
See Also:
SpecificPlaylist.writeTo(java.io.OutputStream, java.lang.String), SpecificPlaylistFactory.readFrom(java.net.URL)

toSpecificPlaylist

SpecificPlaylist toSpecificPlaylist(Playlist playlist)
                                    throws Exception
Builds a specific representation of the given generic playlist.

Parameters:
playlist - a generic playlist. Shall not be null.
Returns:
a specific service playlist. Shall not be null.
Throws:
NullPointerException - if playlist is null.
Exception - if this service provider is unable to represent the input playlist.
See Also:
SpecificPlaylist.toPlaylist()

© 2008-2009 Christophe Delory

Copyright © 2008-2009 Christophe Delory. All Rights Reserved.