public class RegexPlainTextFilter extends AbstractBaseFilter
PlainTextFilter extracts lines of input text, separated by line terminators.
The filter is aware of the following line terminators:
| Modifier and Type | Field and Description |
|---|---|
static String |
FILTER_CONFIG |
static String |
FILTER_CONFIG_LINES |
static String |
FILTER_CONFIG_PARAGRAPHS |
static String |
FILTER_MIME |
static String |
FILTER_NAME |
SUB_FILTER| Constructor and Description |
|---|
RegexPlainTextFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the current process.
|
void |
close()
Closes the input document.
|
protected void |
component_done() |
protected void |
component_init() |
IFilterWriter |
createFilterWriter()
Creates a new IFilterWriter object from the most appropriate class to
use with this filter.
|
ISkeletonWriter |
createSkeletonWriter()
Creates a new ISkeletonWriter object that corresponds to the type of skeleton
this filter uses.
|
String |
getMimeType()
Gets the MIME type of the format supported by this filter.
|
String |
getName()
Gets the name of this component.
|
Parameters |
getParameters()
Gets the current parameters for this component.
|
Parameters |
getRegexParameters()
Provides access to the internal line extractor's
Parameters object. |
boolean |
hasNext()
Indicates if there is an event to process.
|
Event |
next()
Gets the next event available.
|
void |
open(RawDocument input)
Opens the input document described in a give RawDocument object.
|
void |
open(RawDocument input,
boolean generateSkeleton)
Opens the input document described in a give RawDocument object, and
optionally creates skeleton information.
|
void |
setParameters(IParameters params)
Sets new parameters for this component.
|
void |
setRule(String rule,
int sourceGroup,
int regexOptions)
Configures an internal line extractor.
|
addConfiguration, addConfiguration, addConfigurations, findConfiguration, getConfigurations, getDisplayName, getEncoderManager, removeConfiguration, setConfiguration, setDisplayName, setFilterConfigurationMapper, setMimeTypegetParameters, getParametersClassNameexec, getDescription, setDescription, setName, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEachRemaining, removepublic static final String FILTER_NAME
public static final String FILTER_MIME
public static final String FILTER_CONFIG
public static final String FILTER_CONFIG_LINES
public static final String FILTER_CONFIG_PARAGRAPHS
public void setRule(String rule, int sourceGroup, int regexOptions)
rule - - Java regex rule used to extract lines of text. Default: "^(.*?)$".sourceGroup - - regex capturing group denoting text to be extracted. Default: 1.regexOptions - - Java regex options. Default: Pattern.MULTILINE.public Parameters getRegexParameters()
Parameters object.Parameters object; with this object you can access the line extraction rule, source group, regex options, etc.public void cancel()
IFilterpublic void close()
IFilterpublic IFilterWriter createFilterWriter()
IFilterpublic ISkeletonWriter createSkeletonWriter()
IFilterpublic String getMimeType()
IFiltergetMimeType in interface IFiltergetMimeType in class AbstractBaseFilterpublic String getName()
IComponentpublic Parameters getParameters()
IConfigurablegetParameters in interface IFiltergetParameters in interface IConfigurablegetParameters in class OkapiComponentpublic boolean hasNext()
IFilterImplementer Note: The caller must be able to call this method several times without changing state.
public Event next()
IFilterpublic void open(RawDocument input)
IFilterinput - The RawDocument object to use to open the document.public void open(RawDocument input, boolean generateSkeleton)
IFilterinput - The RawDocument object to use to open the document.generateSkeleton - true to generate the skeleton data, false otherwise.public void setParameters(IParameters params)
IConfigurablesetParameters in interface IFiltersetParameters in interface IConfigurablesetParameters in class OkapiComponentparams - The new parameters to use.protected void component_done()
component_done in class OkapiComponentprotected void component_init()
component_init in class OkapiComponentCopyright © 2021. All rights reserved.