com.virtuosotechnologies.lib.plugin
Class SimplePluginInfo

java.lang.Object
  extended bycom.virtuosotechnologies.lib.plugin.SimplePluginInfo
All Implemented Interfaces:
PluginInfo

public class SimplePluginInfo
extends Object
implements PluginInfo

Simple uneditable implementation of PluginInfo. This can only be constructed as a clone of another PluginInfo


Constructor Summary
SimplePluginInfo(PluginInfo original)
          Constructor
 
Method Summary
 String getDescriptionForProvidedAPI(String apiName)
          Get the description for the given provided API.
 URL getJarForProvidedAPI(String apiName)
          Get the Jar URL for the given API spec, or null if no jar is needed.
 String getPluginDescription()
          Get the description of the plugin
 PluginID getPluginID()
          Get the identifier of the plugin
 String getPluginInitializerClassName()
          Get the name of the PluginInitializer implementation class
 URL getPluginJar()
          Get the jar URL for the plugin.
 String getPluginShortDescription()
          Get the short description of the plugin
 String[] getProvidedAPINames()
          Get the provided API names
 String[] getUsedAPINames()
          Get the used API names, both required and optional
 APIVersion getVersionForProvidedAPI(String apiName)
          Get the version for the given provided API.
 APIVersion getVersionForUsedAPI(String apiName)
          Get the version for the given used API.
 boolean isForcingUniqueness()
          Returns true if this plugin wants to be the only version of itself installed.
 boolean isUsedAPIOptional(String apiName)
          Is the given used API optional?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimplePluginInfo

public SimplePluginInfo(PluginInfo original)
Constructor

Parameters:
original - original PluginInfo to copy
Method Detail

getPluginID

public PluginID getPluginID()
Get the identifier of the plugin

Specified by:
getPluginID in interface PluginInfo
Returns:
a PluginID

getPluginDescription

public String getPluginDescription()
Get the description of the plugin

Specified by:
getPluginDescription in interface PluginInfo
Returns:
a String

getPluginShortDescription

public String getPluginShortDescription()
Get the short description of the plugin

Specified by:
getPluginShortDescription in interface PluginInfo
Returns:
a String

getPluginJar

public URL getPluginJar()
Get the jar URL for the plugin.

Specified by:
getPluginJar in interface PluginInfo
Returns:
a URL, or null for no jar

getPluginInitializerClassName

public String getPluginInitializerClassName()
Get the name of the PluginInitializer implementation class

Specified by:
getPluginInitializerClassName in interface PluginInfo
Returns:
a class name

isForcingUniqueness

public boolean isForcingUniqueness()
Returns true if this plugin wants to be the only version of itself installed. If this attribute is true, plugging in this plugin will suppress the simultaneous plugging in of any earlier versions. If an earlier version is already plugged in, this plugin itself will be suppressed. This is useful for plugins that, for example, create GUIs or have other such side effects that should only happen once.

Specified by:
isForcingUniqueness in interface PluginInfo
Returns:
true if this plugin wants to force uniqueness

getProvidedAPINames

public String[] getProvidedAPINames()
Get the provided API names

Specified by:
getProvidedAPINames in interface PluginInfo
Returns:
an array of Strings

getDescriptionForProvidedAPI

public String getDescriptionForProvidedAPI(String apiName)
Get the description for the given provided API.

Specified by:
getDescriptionForProvidedAPI in interface PluginInfo
Parameters:
apiName - name of a provided API
Returns:
a description String
Throws:
NullPointerException - name not found

getVersionForProvidedAPI

public APIVersion getVersionForProvidedAPI(String apiName)
Get the version for the given provided API.

Specified by:
getVersionForProvidedAPI in interface PluginInfo
Parameters:
apiName - name of a provided API
Returns:
an APIVersion
Throws:
NullPointerException - name not found

getJarForProvidedAPI

public URL getJarForProvidedAPI(String apiName)
Get the Jar URL for the given API spec, or null if no jar is needed.

Specified by:
getJarForProvidedAPI in interface PluginInfo
Parameters:
apiName - name of a provided API
Returns:
a URL for the jar, or null for no jar needed
Throws:
NullPointerException - name not found

getUsedAPINames

public String[] getUsedAPINames()
Get the used API names, both required and optional

Specified by:
getUsedAPINames in interface PluginInfo
Returns:
an array of Strings

getVersionForUsedAPI

public APIVersion getVersionForUsedAPI(String apiName)
Get the version for the given used API.

Specified by:
getVersionForUsedAPI in interface PluginInfo
Parameters:
apiName - name of a used API
Returns:
an APIVersion
Throws:
NullPointerException - name not found

isUsedAPIOptional

public boolean isUsedAPIOptional(String apiName)
Is the given used API optional?

Specified by:
isUsedAPIOptional in interface PluginInfo
Parameters:
apiName - name of a used API
Returns:
true if the given needed API is optional
Throws:
NullPointerException - name not found