PluginDescriptor

public class PluginDescriptor

PluginDescriptor is a descriptor containing the configurations of the plugin it represents.

<plugin id="nmtoken" name="nmtoken"? version="nmtoken"? provider-name="nmtoken"? class="nmtoken"?>

       <parameters>?
               <parameter name="nmtoken" value="nmtoken" />*
       </parameters>

       <runtime>?
               <library name="nmtoken" />*
       </runtime>

       <requires>?
               <import plugin="nmtoken" />*
       </requires>

       <extension-point id="nmtoken" class="nmtoken" name="nmtoken"? />*

       <extension point="nmtoken" name="nmtoken"?>*
               <parameter name="nmtoken" value="nmtoken" />*
       </extension>

</plugin>
Author:Hugo Y. K. Lam

Fields

DEFAULT_DESCRIPTOR_NAME

public static final String DEFAULT_DESCRIPTOR_NAME

The default descriptor name (plugin.xml).

Constructors

PluginDescriptor

public PluginDescriptor(File file)

Creates a new instance of PluginDescriptor.

Parameters:
  • file – the plugin descriptor file.
Throws:
  • PluginException – if unable to create the plugin descriptor.
  • FileNotFoundException – if the descriptor file does not exist.

PluginDescriptor

public PluginDescriptor(InputStream ins)

Creates a new instance of PluginDescriptor.

Parameters:
  • ins – the plugin descriptor input stream.
Throws:
  • PluginException – if unable to create the plugin descriptor.

Methods

getExtensionPoints

public Collection getExtensionPoints()

Creates a collection of extension points according to the specified plugin descriptor.

Returns:a collection of extension points.

getExtensions

public Collection getExtensions()

Creates a collection of extensions according to the specified plugin descriptor.

Returns:a collection of extensions.

getHandlerClass

public String getHandlerClass()

Gets the handler class of the plugin.

Returns:the handler class of the plugin.

getId

public String getId()

Gets the plugin ID.

Returns:the plugin ID.

getImports

public Collection getImports()

Creates a collection of imports according to the specified plugin descriptor.

Returns:a collection of imports.

getLibraries

public Collection getLibraries()

Creates a collection of libraries according to the specified plugin descriptor.

Returns:a collection of libraries.

getName

public String getName()

Gets the plugin name.

Returns:the plugin name.

getParameters

public Properties getParameters()

Gets the plugin parameters.

Returns:the plugin parameters.

getParent

public PluginComponent getParent()

Gets the parent plugin component of this descriptor.

Returns:the parent plugin component of this descriptor.

getProviderName

public String getProviderName()

Gets the plugin provider name.

Returns:the plugin provider name.

getVersion

public String getVersion()

Gets the plugin version.

Returns:the plugin version.

setParent

public void setParent(PluginComponent parent)

Sets the parent plugin component of this descriptor.

Parameters:
  • parent – the parent plugin component of this descriptor.