Package net.sf.okapi.steps.common
Class FilterEventsToRawDocumentStep
- java.lang.Object
-
- net.sf.okapi.common.pipeline.BasePipelineStep
-
- net.sf.okapi.steps.common.FilterEventsToRawDocumentStep
-
- All Implemented Interfaces:
AutoCloseable
,Function<Stream<Event>,Stream<Event>>
,IPipelineStep
public class FilterEventsToRawDocumentStep extends BasePipelineStep
Converts filters events into aRawDocument
. This class implements theIPipelineStep
interface for a step that takes filter events and creates an output document using theIFilterWriter
implementation provided by the filter through the START_DOCUMENT event. When the document is completed, aRawDocument
is generated.
-
-
Constructor Summary
Constructors Constructor Description FilterEventsToRawDocumentStep()
Create a new FilterEventsToRawDocumentStep object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDescription()
Gets a short localizable description of what this step does.String
getName()
Gets the localizable name of this step.Event
handleEvent(Event event)
Catch all incomingEvent
s and write them out to the output document.protected Event
handleStartDocument(Event event)
Handles theEventType.START_DOCUMENT
event.void
setOutputEncoding(String outputEncoding)
void
setOutputStream(OutputStream outputStream)
void
setOutputURI(URI outputURI)
void
setTargetLocale(LocaleId targetLocale)
-
Methods inherited from class net.sf.okapi.common.pipeline.BasePipelineStep
cancel, destroy, getHelpLocation, getParameters, getSourceLocale, getTargetLocale, handleCustom, handleDocumentPart, handleEndBatch, handleEndBatchItem, handleEndDocument, handleEndGroup, handleEndSubDocument, handleEndSubfilter, handleMultiEvent, handlePipelineParameters, handleRawDocument, handleStartBatch, handleStartBatchItem, handleStartGroup, handleStartSubDocument, handleStartSubfilter, handleTextUnit, isDone, isLastOutputStep, setLastOutputStep, setParameters, setSourceLocale
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.okapi.common.pipeline.IPipelineStep
apply, close, handleStream
-
-
-
-
Method Detail
-
setOutputURI
public void setOutputURI(URI outputURI)
-
setOutputStream
public void setOutputStream(OutputStream outputStream)
-
setTargetLocale
public void setTargetLocale(LocaleId targetLocale)
- Specified by:
setTargetLocale
in interfaceIPipelineStep
- Overrides:
setTargetLocale
in classBasePipelineStep
-
setOutputEncoding
public void setOutputEncoding(String outputEncoding)
-
getName
public String getName()
Description copied from interface:IPipelineStep
Gets the localizable name of this step.- Returns:
- the localizable name of this step.
-
getDescription
public String getDescription()
Description copied from interface:IPipelineStep
Gets a short localizable description of what this step does.- Returns:
- the text of a short description of what this step does.
-
handleEvent
public Event handleEvent(Event event)
Catch all incomingEvent
s and write them out to the output document. This step generates NO_OP events until the input events are exhausted, at which point a RawDocument event is sent.- Specified by:
handleEvent
in interfaceIPipelineStep
- Overrides:
handleEvent
in classBasePipelineStep
- Parameters:
event
- the event to process.- Returns:
- the event to pass down the pipeline.
-
handleStartDocument
protected Event handleStartDocument(Event event)
Description copied from class:BasePipelineStep
Handles theEventType.START_DOCUMENT
event.- Overrides:
handleStartDocument
in classBasePipelineStep
- Parameters:
event
- event to handle.- Returns:
- the event returned.
-
-