org.stanwood.media.extensions
Class ExtensionInfo<T extends IExtension>

java.lang.Object
  extended by org.stanwood.media.extensions.ExtensionInfo<T>
Type Parameters:
T - The type of the extension
Direct Known Subclasses:
ExecuteSystemCommandActionInfo, HybridFilmSourceInfo, MemoryStoreInfo, MP4ITunesStoreInfo, PodCastActionInfo, RemoteMacOSXItunesStoreInfo, RenameActionInfo, SapphireStoreInfo, TagChimpSourceInfo, XBMCSourceInfo, XMLStore2Info

public abstract class ExtensionInfo<T extends IExtension>
extends java.lang.Object

Used to describe extensions to the media manager


Constructor Summary
ExtensionInfo(ExtensionType type)
          The constructor
ExtensionInfo(java.lang.String id, ExtensionType type, ParameterType[] parameterInfos)
          The constructor
 
Method Summary
protected abstract  T createExtension()
          Used to create the extension
 T getAnyExtension(MediaDirConfig config)
          Used to get any extension from the media directory configuration.
 T getExtension(MediaDirConfig config, int number)
          Used to get the extension class type
 java.lang.String getId()
          Used to get the id of the extension
 ParameterType[] getParameterInfos()
          Used to get information on the parameters
 ExtensionType getType()
          Used to get the type of the extension
protected  void setId(java.lang.String id)
          Used to set the id of the extension
protected  void setParameterInfos(ParameterType[] parameterInfos)
          Used to set the parameter information
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionInfo

public ExtensionInfo(ExtensionType type)
The constructor

Parameters:
type - The type of the extension

ExtensionInfo

public ExtensionInfo(java.lang.String id,
                     ExtensionType type,
                     ParameterType[] parameterInfos)
The constructor

Parameters:
id - The id of the extension
parameterInfos - The parameter info
type - The type of the extension
Method Detail

getExtension

public T getExtension(MediaDirConfig config,
                      int number)
                                  throws ExtensionException
Used to get the extension class type

Parameters:
config - The media directory configuration
number - The index number of the extension
Returns:
The extension class type
Throws:
ExtensionException - Thrown if their is a problem creating the extension

createExtension

protected abstract T createExtension()
                                                 throws ExtensionException
Used to create the extension

Returns:
The extension
Throws:
ExtensionException - Thrown if their is a problem

getAnyExtension

public T getAnyExtension(MediaDirConfig config)
                                     throws ExtensionException
Used to get any extension from the media directory configuration. So if their are multiple XBMCSources, then it will just pick one of them.

Parameters:
config - The media directory configuration
Returns:
The extension
Throws:
ExtensionException - Thrown if their is a problem getting the extension

getParameterInfos

public ParameterType[] getParameterInfos()
Used to get information on the parameters

Returns:
The parameter information

setParameterInfos

protected void setParameterInfos(ParameterType[] parameterInfos)
Used to set the parameter information

Parameters:
parameterInfos - The parameter information

getId

public java.lang.String getId()
Used to get the id of the extension

Returns:
The id of the extension

setId

protected void setId(java.lang.String id)
Used to set the id of the extension

Parameters:
id - The id of the extension

getType

public ExtensionType getType()
Used to get the type of the extension

Returns:
The type of the extension