Module jdk.jlink
Package jdk.tools.jlink.plugin

## Interface Plugin

All Known Subinterfaces:
  PostProcessorPlugin, TransformerPlugin

    public interface Plugin

Base interface that jlink plugins should implement.

### Nested Class Summary

Nested Classes

`static class`

`Plugin.CATEGORY`
Order of categories: FILTER: Filter in/out resources or files. TRANSFORMER: Transform resources or files(eg: refactoring, bytecode manipulation). MODULEINFO_TRANSFORMER: Transform only module-info.class SORTER: Sort resources within the resource container. COMPRESSOR: Compress resource within the resouce containers. VERIFIER: Does some image verification. PROCESSOR: Does some post processing on image. PACKAGER: Final processing

`static interface` `Plugin.PluginType` Type of plugin.
`static class` `Plugin.STATE` Plugin state: DISABLED: The plugin is not exposed in help and will be not called. AUTO_ENABLED: The plugin is enabled by default.

### Method Summary

All Methods Instance Methods Default Methods
`default void` `configure(Map<String,String> config)` Configure the plugin based on the passed configuration.
`default void` `configure(Map<String,String> config, PluginContext ctx)` Configure the plugin based on the passed configuration.
`default String` `getArgumentsDescription()` The plugin argument(s) description.
`default String` `getDescription()` The plugin description.
`default String` `getName()` The plugin name.
`default String` `getOption()` The option that identifies this plugin.
`default Set<Plugin.STATE>` `getState()` The Plugin set of states.
`default String` `getStateDescription()` Return a message indicating the status of the provider.
`default Set<Plugin.PluginType>` `getType()` The Plugin set of types.
`default boolean` `hasArguments()` Has this plugin require one or more arguments? A plugin can have one or more optional arguments.
`default Set<String>` `isAfter()` The set of plugin names that must be located, within the stack of plugins, after this plugin.
`default Set<String>` `isBefore()` The set of plugin names that must be located, within the stack of plugins, before this plugin.

### Method Detail

#### getType

    default Set<Plugin.PluginType> getType()

The Plugin set of types.

Returns:
  The set of types.

#### getState

    default Set<Plugin.STATE> getState()

The Plugin set of states.

Returns:
  The set of states.

#### isBefore

    default Set<String> isBefore()

The set of plugin names that must be located, within the stack of plugins, before this plugin.

Returns:
  The set of names. By default this set is empty.

#### isAfter

    default Set<String> isAfter()

The set of plugin names that must be located, within the stack of plugins, after this plugin.

Returns:
  The set of names. By default this set is empty.

#### getName

    default String getName()

The plugin name.

Returns:
  The name.

#### getDescription

    default String getDescription()

The plugin description.

Returns:
  The description.

#### getOption

    default String getOption()

The option that identifies this plugin. This may be null. "--" is prefixed to the String (when non-null) when invoking this plugin from jlink command line.

Returns:
  The plugin option.

#### hasArguments

    default boolean hasArguments()

Has this plugin require one or more arguments? A plugin can have one or more optional arguments.
A plugin option with a single argument is specified as follows:

         --plugin-option=arg_value

If there are more than arguments, command line option looks like:

         --plugin-option=arg_value:arg2=value2:arg3=value3...

Returns:
  true if arguments are needed.

#### getArgumentsDescription

    default String getArgumentsDescription()

The plugin argument(s) description.

Returns:
  The argument(s) description.

#### getStateDescription

    default String getStateDescription()

Return a message indicating the status of the provider.

Returns:
  A status description.

#### configure

    default void configure(Map<String,String> config)

Configure the plugin based on the passed configuration. This method is called prior to invoke the plugin.

Parameters:
  `config` - The plugin configuration.

#### configure

    default void configure(Map<String,String> config,
                           PluginContext ctx)

Configure the plugin based on the passed configuration. This method is called prior to invoke the plugin.

Parameters:
  `config` - The plugin configuration.
  `ctx` - The plugin context