org.apache.nutch.plugin

## Class PluginDescriptor

- java.lang.Object
- - org.apache.nutch.plugin.PluginDescriptor

-     public class PluginDescriptor
      extends java.lang.Object

  The `PluginDescriptor` provide access to all meta information of a nutch-plugin, as well to the internationalizable resources and the plugin own classloader. There are meta information about `Plugin`, `ExtensionPoint` and `Extension`. To provide access to the meta data of a plugin via a descriptor allow a lazy loading mechanism.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PluginDescriptor(java.lang.String pId, java.lang.String pVersion, java.lang.String pName, java.lang.String pProviderName, java.lang.String pPluginclazz, java.lang.String pPath, Configuration conf)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDependency(java.lang.String pId)` Adds a dependency
    `void` | `addExportedLibRelative(java.lang.String pLibPath)` Adds a exported library with a relative path to the plugin directory.
    `void` | `addExtension(Extension pExtension)` Adds a extension.
    `void` | `addExtensionPoint(ExtensionPoint extensionPoint)` Adds a extension point.
    `void` | `addNotExportedLibRelative(java.lang.String pLibPath)` Adds a not exported library with a plugin directory relative path.
    `PluginClassLoader` | `getClassLoader()` Returns a cached classloader for a plugin.
    `java.lang.String[]` | `getDependencies()` Returns a array of plugin ids.
    `java.net.URL[]` | `getExportedLibUrls()` Returns a array exported librareis as URLs
    `Extension[]` | `getExtensions()` Returns an array of extensions.
    `ExtensionPoint[]` | `getExtenstionPoints()` Returns a array of extension points.
    `java.lang.String` | `getName()` Returns the name of the plugin.
    `java.net.URL[]` | `getNotExportedLibUrls()` Returns a array of libraries as URLs that are not exported by the plugin.
    `java.lang.String` | `getPluginClass()` Returns the fully qualified name of the class which implements the abstarct `Plugin` class.
    `java.lang.String` | `getPluginId()` Returns the unique identifier of the plug-in or `null`.
    `java.lang.String` | `getPluginPath()` Returns the directory path of the plugin.
    `java.lang.String` | `getProviderName()`
    `java.lang.String` | `getResourceString(java.lang.String pKey, java.util.Locale pLocale)` Returns a I18N'd resource string.
    `java.lang.String` | `getVersion()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PluginDescriptor

          public PluginDescriptor(java.lang.String pId,
                                  java.lang.String pVersion,
                                  java.lang.String pName,
                                  java.lang.String pProviderName,
                                  java.lang.String pPluginclazz,
                                  java.lang.String pPath,
                                  Configuration conf)

      Constructor
      Parameters:
        `pId` -
        `pVersion` -
        `pName` -
        `pProviderName` -
        `pPluginclazz` -
        `pPath` -

  - ### Method Detail

    - #### getName

          public java.lang.String getName()

      Returns the name of the plugin.
      Returns:
        String

    - #### getPluginClass

          public java.lang.String getPluginClass()

      Returns the fully qualified name of the class which implements the abstarct `Plugin` class.
      Returns:
        the name of this plug-in's runtime class or `null`.

    - #### getPluginId

          public java.lang.String getPluginId()

      Returns the unique identifier of the plug-in or `null`.
      Returns:
        String

    - #### getExtensions

          public Extension[] getExtensions()

      Returns an array of extensions.
      Returns:
        Exception[]

    - #### addExtension

          public void addExtension(Extension pExtension)

      Adds a extension.
      Parameters:
        `pExtension` -

    - #### addExtensionPoint

          public void addExtensionPoint(ExtensionPoint extensionPoint)

      Adds a extension point.
      Parameters:
        `extensionPoint` -

    - #### getExtenstionPoints

          public ExtensionPoint[] getExtenstionPoints()

      Returns a array of extension points.
      Returns:
        ExtensionPoint[]

    - #### getDependencies

          public java.lang.String[] getDependencies()

      Returns a array of plugin ids.
      Returns:
        String[]

    - #### addDependency

          public void addDependency(java.lang.String pId)

      Adds a dependency
      Parameters:
        `pId` - id of the dependent plugin

    - #### addExportedLibRelative

          public void addExportedLibRelative(java.lang.String pLibPath)
                                      throws java.net.MalformedURLException

      Adds a exported library with a relative path to the plugin directory.
      Parameters:
        `pLibPath` -
      Throws:
        `java.net.MalformedURLException`

    - #### getPluginPath

          public java.lang.String getPluginPath()

      Returns the directory path of the plugin.
      Returns:
        String

    - #### getExportedLibUrls

          public java.net.URL[] getExportedLibUrls()

      Returns a array exported librareis as URLs
      Returns:
        URL[]

    - #### addNotExportedLibRelative

          public void addNotExportedLibRelative(java.lang.String pLibPath)
                                         throws java.net.MalformedURLException

      Adds a not exported library with a plugin directory relative path.
      Parameters:
        `pLibPath` -
      Throws:
        `java.net.MalformedURLException`

    - #### getNotExportedLibUrls

          public java.net.URL[] getNotExportedLibUrls()

      Returns a array of libraries as URLs that are not exported by the plugin.
      Returns:
        URL[]

    - #### getClassLoader

          public PluginClassLoader getClassLoader()

      Returns a cached classloader for a plugin. Until classloader creation all needed libraries are collected. A classloader use as first the plugins own libraries and add then all exported libraries of dependend plugins.
      Returns:
        PluginClassLoader the classloader for the plugin

    - #### getResourceString

          public java.lang.String getResourceString(java.lang.String pKey,
                                                    java.util.Locale pLocale)
                                             throws java.io.IOException

      Returns a I18N'd resource string. The resource bundles could be stored in root directory of a plugin in the well know i18n file name conventions.
      Parameters:
        `pKey` -
        `pLocale` -
      Returns:
        String
      Throws:
        `java.io.IOException`

    - #### getProviderName

          public java.lang.String getProviderName()

    - #### getVersion

          public java.lang.String getVersion()

Copyright © 2019 The Apache Software Foundation