public abstract class AbstractLineFilter extends AbstractBaseFilter
| Modifier and Type | Field and Description |
|---|---|
protected RawDocument |
input |
static String |
LINE_NUMBER |
protected LocaleId |
srcLang |
protected StartDocument |
startDoc |
protected LocaleId |
trgLang |
SUB_FILTER| Constructor and Description |
|---|
AbstractLineFilter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addLineBreak() |
void |
cancel()
Cancels the current process.
|
void |
close()
Closes the input document.
|
protected TextProcessingResult |
component_exec(TextContainer lineContainer)
Called by the filter for every line read from the input
|
protected void |
component_idle(boolean lastChance)
Called by the filter when there are no input lines (the input has been read).
|
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.
|
protected GenericSkeleton |
getActiveSkeleton() |
IFilterWriter |
getFilterWriter() |
protected DocumentPart |
getFirstDocumentPart() |
protected ITextUnit |
getFirstTextUnit() |
protected GenericSkeleton |
getHeadSkeleton() |
protected String |
getLineBreak() |
protected int |
getQueueSize() |
protected LocaleId |
getTargetLocale() |
boolean |
hasNext()
Indicates if there is an event to process.
|
boolean |
isMultilingual() |
Event |
next()
Gets the next event available.
|
boolean |
notify(String notification,
Object info) |
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.
|
protected boolean |
sendEvent(EventType eventType,
IResource res) |
protected boolean |
sendEvent(int index,
EventType eventType,
IResource res) |
void |
setFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)
Sets the filter configuration mapper for this filter.
|
void |
setFilterWriter(IFilterWriter filterWriter) |
protected void |
setMultilingual(boolean multilingual) |
addConfiguration, addConfiguration, addConfigurations, findConfiguration, getConfigurations, getDisplayName, getEncoderManager, getMimeType, removeConfiguration, setConfiguration, setDisplayName, setMimeTypecomponent_done, getParameters, getParameters, getParametersClassName, setParametersexec, getDescription, getName, setDescription, setName, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetName, getParameters, setParameters, streamforEachRemaining, removepublic static final String LINE_NUMBER
protected LocaleId srcLang
protected LocaleId trgLang
protected StartDocument startDoc
protected RawDocument input
public void cancel()
IFilterpublic final void close()
IFilterpublic void setFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)
IFiltersetFilterConfigurationMapper in interface IFiltersetFilterConfigurationMapper in class AbstractBaseFilterfcMapper - the mapper to set.public IFilterWriter createFilterWriter()
IFilterpublic ISkeletonWriter createSkeletonWriter()
IFilterpublic IFilterWriter getFilterWriter()
public void setFilterWriter(IFilterWriter filterWriter)
protected void setMultilingual(boolean multilingual)
public boolean isMultilingual()
protected void component_init()
component_init in class OkapiComponentprotected TextProcessingResult component_exec(TextContainer lineContainer)
lineContainer - protected void component_idle(boolean lastChance)
lastChance - True if there are no events in the queue, and if the method will not produce events, the filter will be finished.public boolean hasNext()
IFilterImplementer Note: The caller must be able to call this method several times without changing state.
public 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.protected ITextUnit getFirstTextUnit()
protected DocumentPart getFirstDocumentPart()
protected LocaleId getTargetLocale()
public Event next()
IFilterprotected final GenericSkeleton getActiveSkeleton()
protected final GenericSkeleton getHeadSkeleton()
protected final int getQueueSize()
protected final boolean sendEvent(int index,
EventType eventType,
IResource res)
index - eventType - res - protected final String getLineBreak()
protected final void addLineBreak()
Copyright © 2021. All rights reserved.