Package net.sf.okapi.common.filters
Class FilterConfiguration
- java.lang.Object
-
- net.sf.okapi.common.filters.FilterConfiguration
-
public class FilterConfiguration extends Object
Data set defining a filter configuration.
-
-
Field Summary
Fields Modifier and Type Field Description URLClassLoaderclassLoaderClass loader to use for this filter (null to use the default).StringconfigIdUnique identifier for this configuration.booleancustomFlag indicating if this configuration is custom or pre-defined.StringdescriptionLonger localizable description of for this configuration.StringextensionsList of extensions corresponding to this configuration.StringfilterClassThe full name of the class that implement the filter for this configuration.StringmimeTypeMIME type for this configuration.StringnameShort localizable name for this configuration.IParametersparametersThe parameters for this configuration.StringparametersLocationThe location of the parameters for this configuration.
-
Constructor Summary
Constructors Constructor Description FilterConfiguration()Creates an empty FilterConfiguration object.FilterConfiguration(String configId, String mimeType, String filterClass, String name, String description)Creates a FilterConfiguration object and initializes it.FilterConfiguration(String configId, String mimeType, String filterClass, String name, String description, String parametersLocation)Creates a FilterConfiguration object and initializes it.FilterConfiguration(String configId, String mimeType, String filterClass, String name, String description, String parametersLocation, String extensions)Creates a FilterConfiguration object and initializes it.FilterConfiguration(String configId, String mimeType, String filterClass, String name, String description, String parametersLocation, IParameters parameters, String extensions)Creates a FilterConfiguration object and initializes it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidloadParametersFromStream(InputStream stream)Load theIParametersfrom the giveInputStream
-
-
-
Field Detail
-
configId
public String configId
Unique identifier for this configuration.
-
filterClass
public String filterClass
The full name of the class that implement the filter for this configuration.
-
parametersLocation
public 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 String name
Short localizable name for this configuration.
-
description
public 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 String mimeType
MIME type for this configuration.
-
classLoader
public URLClassLoader classLoader
Class loader to use for this filter (null to use the default).
-
extensions
public 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(String configId, String mimeType, String filterClass, String name, String description, String parametersLocation, 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(String configId, String mimeType, String filterClass, String name, String description, 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(String configId, String mimeType, String filterClass, String name, 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(String configId, String mimeType, String filterClass, String name, String description, String parametersLocation, IParameters parameters, 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(InputStream stream)
Load theIParametersfrom the giveInputStream- Parameters:
stream- - stream of the parameter file.
-
-