Lizzy v1.1.1

christophedelory.playlist.xspf
Class XspfProvider

java.lang.Object
  extended by christophedelory.playlist.xspf.XspfProvider
All Implemented Interfaces:
SpecificPlaylistProvider

public class XspfProvider
extends Object
implements SpecificPlaylistProvider

XML Shareable Playlist Format (XSPF), pronounced spiff, is an XML-based playlist format for digital media, sponsored by the Xiph.Org Foundation. Lucas Gonze of Yahoo.com/Webjay.org originated the format in 2004. XSPF is a data format for sharing the kind of playlist that can be played on a personal computer or portable device. In the same way that any user on any computer can open any web page, XSPF is intended to provide portability for playlists.

Version:
$Revision: 91 $
Author:
Christophe Delory

Constructor Summary
XspfProvider()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XspfProvider

public XspfProvider()
Method Detail

getId

public String getId()
Description copied from interface: SpecificPlaylistProvider
Returns a unique string identifying the type of specific playlists handled by this provider.

Specified by:
getId in interface SpecificPlaylistProvider
Returns:
a playlist identifier. Shall not be null.

getContentTypes

public ContentType[] getContentTypes()
Description copied from interface: SpecificPlaylistProvider
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.

Specified by:
getContentTypes in interface SpecificPlaylistProvider
Returns:
a list of content types. Shall not be null nor empty.

readFrom

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

Specified by:
readFrom in interface SpecificPlaylistProvider
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.
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

public SpecificPlaylist toSpecificPlaylist(Playlist playlist)
                                    throws Exception
Description copied from interface: SpecificPlaylistProvider
Builds a specific representation of the given generic playlist.

Specified by:
toSpecificPlaylist in interface SpecificPlaylistProvider
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.