net.sf.okapi.common.filters

## Class FilterConfiguration

- java.lang.Object
- - net.sf.okapi.common.filters.FilterConfiguration

-     public class FilterConfiguration
      extends java.lang.Object

  Data set defining a filter configuration.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.net.URLClassLoader` | `classLoader` Class loader to use for this filter (null to use the default).
    `java.lang.String` | `configId` Unique identifier for this configuration.
    `boolean` | `custom` Flag indicating if this configuration is custom or pre-defined.
    `java.lang.String` | `description` Longer localizable description of for this configuration.
    `java.lang.String` | `extensions` List of extensions corresponding to this configuration.
    `java.lang.String` | `filterClass` The full name of the class that implement the filter for this configuration.
    `java.lang.String` | `mimeType` MIME type for this configuration.
    `java.lang.String` | `name` Short localizable name for this configuration.
    `IParameters` | `parameters` The parameters for this configuration.
    `java.lang.String` | `parametersLocation` The location of the parameters for this configuration.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FilterConfiguration()` Creates an empty FilterConfiguration object.
    `FilterConfiguration(java.lang.String configId, java.lang.String mimeType, java.lang.String filterClass, java.lang.String name, java.lang.String description)` Creates a FilterConfiguration object and initializes it.
    `FilterConfiguration(java.lang.String configId, java.lang.String mimeType, java.lang.String filterClass, java.lang.String name, java.lang.String description, java.lang.String parametersLocation)` Creates a FilterConfiguration object and initializes it.
    `FilterConfiguration(java.lang.String configId, java.lang.String mimeType, java.lang.String filterClass, java.lang.String name, java.lang.String description, java.lang.String parametersLocation, IParameters parameters, java.lang.String extensions)` Creates a FilterConfiguration object and initializes it.
    `FilterConfiguration(java.lang.String configId, java.lang.String mimeType, java.lang.String filterClass, java.lang.String name, java.lang.String description, java.lang.String parametersLocation, java.lang.String extensions)` Creates a FilterConfiguration object and initializes it.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `loadParametersFromStream(java.io.InputStream stream)` Load the `IParameters` from the give `InputStream`

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

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

- - ### Field Detail

    - #### configId

          public java.lang.String configId

      Unique identifier for this configuration.

    - #### filterClass

          public java.lang.String filterClass

      The full name of the class that implement the filter for this configuration.

    - #### parametersLocation

          public java.lang.String parametersLocation

      The location of the parameters for this configuration. This should be the name of the file where the configuration is stored in the package resource for a pre-defined configurations; it can be null if the configuration is the default one, and it can be anything for a custom configuration.

    - #### parameters

          public IParameters parameters

      The parameters for this configuration. It can be null if the configuration is the default one, and it can be anything for a custom configuration. This will override parametersLocation of non-null.

    - #### name

          public java.lang.String name

      Short localizable name for this configuration.

    - #### description

          public java.lang.String description

      Longer localizable description of for this configuration.

    - #### custom

          public boolean custom

      Flag indicating if this configuration is custom or pre-defined.

    - #### mimeType

          public java.lang.String mimeType

      MIME type for this configuration.

    - #### classLoader

          public java.net.URLClassLoader classLoader

      Class loader to use for this filter (null to use the default).

    - #### extensions

          public java.lang.String extensions

      List of extensions corresponding to this configuration. The list can be null. Otherwise it must be in the form: ".ext1;.ext2;" The ';' must be present even when there is only one extension. All extensions must have the '.'

  - ### Constructor Detail

    - #### FilterConfiguration

          public FilterConfiguration()

      Creates an empty FilterConfiguration object.

    - #### FilterConfiguration

          public FilterConfiguration(java.lang.String configId,
                             java.lang.String mimeType,
                             java.lang.String filterClass,
                             java.lang.String name,
                             java.lang.String description,
                             java.lang.String parametersLocation,
                             java.lang.String extensions)

      Creates a FilterConfiguration object and initializes it.
      Parameters:
        `configId` - the configuration identifier.
        `mimeType` - the MIME type associated with this configuration.
        `filterClass` - the filter class name.
        `name` - the localizable name of this configuration.
        `description` - the localizable description of this configuration.
        `parametersLocation` - the location where the parameters for this configuration are stored.
        `extensions` - the extensions for this configuration (eg. ".htm;.html;")

    - #### FilterConfiguration

          public FilterConfiguration(java.lang.String configId,
                             java.lang.String mimeType,
                             java.lang.String filterClass,
                             java.lang.String name,
                             java.lang.String description,
                             java.lang.String parametersLocation)

      Creates a FilterConfiguration object and initializes it.
      Parameters:
        `configId` - the configuration identifier.
        `mimeType` - the MIME type associated with this configuration.
        `filterClass` - the filter class name.
        `name` - the localizable name of this configuration.
        `description` - the localizable description of this configuration.
        `parametersLocation` - the location where the parameters for this configuration are stored.

    - #### FilterConfiguration

          public FilterConfiguration(java.lang.String configId,
                             java.lang.String mimeType,
                             java.lang.String filterClass,
                             java.lang.String name,
                             java.lang.String description)

      Creates a FilterConfiguration object and initializes it.
      Parameters:
        `configId` - the configuration identifier.
        `mimeType` - the MIME type associated with this configuration.
        `filterClass` - the filter class name.
        `name` - the localizable name of this configuration.
        `description` - the localizable description of this configuration.

    - #### FilterConfiguration

          public FilterConfiguration(java.lang.String configId,
                             java.lang.String mimeType,
                             java.lang.String filterClass,
                             java.lang.String name,
                             java.lang.String description,
                             java.lang.String parametersLocation,
                             IParameters parameters,
                             java.lang.String extensions)

      Creates a FilterConfiguration object and initializes it.
      Parameters:
        `configId` - the configuration identifier.
        `mimeType` - the MIME type associated with this configuration.
        `filterClass` - the filter class name.
        `name` - the localizable name of this configuration.
        `description` - the localizable description of this configuration.
        `parametersLocation` - the location where the parameters for this configuration are stored. (use null if there are no parameters).
        `parameters` - custom parameter instance for this filter.
        `extensions` - the extensions for this configuration (eg. ".htm;.html;")

  - ### Method Detail

    - #### loadParametersFromStream

          public void loadParametersFromStream(java.io.InputStream stream)

      Load the `IParameters` from the give `InputStream`
      Parameters:
        `stream` - - stream of the parameter file.