Package com.xmlmind.w2x.processor

## Class Plugin

- java.lang.Object
- - com.xmlmind.w2x.processor.Plugin

-     public final class Plugin
      extends Object

  A `Processor` plugin is basically some `w2x` command-line arguments identified by a name.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static Plugin[]` | `EMPTY_LIST` | A ready-to-use empty array of plugins.
    `boolean` | `multiFileOutput` | `true` if this plugin creates multiple output files (like Web Help); `false` if this plugin creates a single output file (like EPUB).
    `String` | `name` | The unique name (a single word) of the plugin.
    `String` | `outputDescription` | A short description (just a few words) of the output files created by this plugin.
    `String` | `outputExtension` | The suggested file extension, without a leading dot, for the output files created by this plugin.
    `String[]` | `w2xArguments` | Some `w2x` command-line arguments specifying what does this plugin.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Plugin​(String name, String outputDescription, String outputExtension, boolean multiFileOutput, String[] w2xArguments)` | Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static Plugin` | `load​(URL url)` | Load the plugin found in specified location.
    `static Plugin[]` | `loadAll​(URL[] urls, List<String> errorList)` | Load all the plugins found in specified locations.
    `String` | `toString()` | Returns a parsable representation of this plugin, that is, the content of a `.w2x_plugin` file.

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

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

- - ### Field Detail

    - #### name

          public final String name

      The unique name (a single word) of the plugin. Example: "`rss`".

    - #### outputDescription

          public final String outputDescription

      A short description (just a few words) of the output files created by this plugin. Example: "`RSS 2.0`". May be `null`.

    - #### outputExtension

          public final String outputExtension

      The suggested file extension, without a leading dot, for the output files created by this plugin. Example: "`xml`".

    - #### multiFileOutput

          public final boolean multiFileOutput

      `true` if this plugin creates multiple output files (like Web Help); `false` if this plugin creates a single output file (like EPUB).

    - #### w2xArguments

          public final String[] w2xArguments

      Some `w2x` command-line arguments specifying what does this plugin. May not be an empty array.

    - #### EMPTY_LIST

          public static final Plugin[] EMPTY_LIST

      A ready-to-use empty array of plugins.

  - ### Constructor Detail

    - #### Plugin

          public Plugin​(String name,
                        String outputDescription,
                        String outputExtension,
                        boolean multiFileOutput,
                        String[] w2xArguments)

      Constructor.

  - ### Method Detail

    - #### toString

          public String toString()

      Returns a parsable representation of this plugin, that is, the content of a `.w2x_plugin` file.
      Overrides:
        `toString` in class `Object`

    - #### loadAll

          public static Plugin[] loadAll​(URL[] urls,
                                         List<String> errorList)

      Load all the plugins found in specified locations.
      Parameters:
        `urls` - locations of `.w2x_plugin` files.
        `errorList` - error messages reported while loading the plugins are added to this list.
      Returns:
        loaded plugins.
      See Also:
        `load(java.net.URL)`

    - #### load

          public static Plugin load​(URL url)
                             throws IOException,
                                    UsageException

      Load the plugin found in specified location.
      Parameters:
        `url` - location of a `.w2x_plugin` file.
      Returns:
        loaded plugin.
      Throws:
        `IOException` - problem reading the file or missing plugin fields
        `UsageException` - syntax errors in loaded `w2x` command-line arguments
      See Also:
        `loadAll(java.net.URL[], java.util.List<java.lang.String>)`