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 theIPipelineStepinterface for a step that takes filter events and creates an output document using theIFilterWriterimplementation provided by the filter through the START_DOCUMENT event. When the document is completed, aRawDocumentis 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 StringgetDescription()Gets a short localizable description of what this step does.StringgetName()Gets the localizable name of this step.EventhandleEvent(Event event)Catch all incomingEvents and write them out to the output document.protected EventhandleStartDocument(Event event)Handles theEventType.START_DOCUMENTevent.voidsetOutputEncoding(String outputEncoding)voidsetOutputStream(OutputStream outputStream)voidsetOutputURI(URI outputURI)voidsetTargetLocale(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:
setTargetLocalein interfaceIPipelineStep- Overrides:
setTargetLocalein classBasePipelineStep
-
setOutputEncoding
public void setOutputEncoding(String outputEncoding)
-
getName
public String getName()
Description copied from interface:IPipelineStepGets the localizable name of this step.- Returns:
- the localizable name of this step.
-
getDescription
public String getDescription()
Description copied from interface:IPipelineStepGets 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 incomingEvents 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:
handleEventin interfaceIPipelineStep- Overrides:
handleEventin 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:BasePipelineStepHandles theEventType.START_DOCUMENTevent.- Overrides:
handleStartDocumentin classBasePipelineStep- Parameters:
event- event to handle.- Returns:
- the event returned.
-
-