public abstract class AbstractLineFilter extends AbstractFilter
| 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 void |
done() |
protected GenericSkeleton |
getActiveSkeleton() |
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.
|
protected void |
init() |
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.
|
protected abstract TextProcessingResult |
processLine(TextContainer lineContainer)
Called by the filter for every line read from the input
|
protected boolean |
sendEvent(EventType eventType,
IResource res) |
protected boolean |
sendEvent(int index,
EventType eventType,
IResource res) |
protected void |
waitForLine(boolean lastChance)
Called by the filter when there are no input lines (the input has been read).
|
addConfiguration, addConfiguration, addConfiguration, addConfigurations, createEndFilterEvent, createFilterWriter, createSkeletonWriter, createStartFilterEvent, findConfiguration, getConfiguration, getConfigurations, getDisplayName, getDocumentId, getDocumentName, getEncoderManager, getEncoding, getFilterConfigurationMapper, getFilterWriter, getMimeType, getName, getNewlineType, getParameters, getParameters, getParametersClassName, getParentId, getSrcLoc, getTrgLoc, isCanceled, isGenerateSkeleton, isMultilingual, isUtf8Bom, isUtf8Encoding, removeConfiguration, setDisplayName, setDocumentName, setEncoding, setFilterConfigurationMapper, setFilterWriter, setGenerateSkeleton, setMimeType, setMultilingual, setName, setNewlineType, setOptions, setParameters, setParentId, setSrcLoc, setTrgLocclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, removepublic static final String LINE_NUMBER
protected LocaleId srcLang
protected LocaleId trgLang
protected StartDocument startDoc
protected RawDocument input
public void cancel()
IFiltercancel in interface IFiltercancel in class AbstractFilterpublic final void close()
IFilterclose in interface AutoCloseableclose in interface IFilterclose in class AbstractFilterpublic 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)
IFilteropen in interface IFilteropen in class AbstractFilterinput - 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()
protected void init()
protected void done()
protected abstract TextProcessingResult processLine(TextContainer lineContainer)
lineContainer - protected void waitForLine(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.Copyright © 2022. All rights reserved.