Package net.sf.okapi.steps.common
Class FilterEventsWriterStep
- java.lang.Object
-
- net.sf.okapi.common.pipeline.BasePipelineStep
-
- net.sf.okapi.steps.common.FilterEventsWriterStep
-
- All Implemented Interfaces:
AutoCloseable,Function<Stream<Event>,Stream<Event>>,IPipelineStep
public class FilterEventsWriterStep extends BasePipelineStep
Outputs filters events into a document. This class implements theIPipelineStepinterface for a step that takes filter events and creates an output document using a providedIFilterWriterimplementation. Each event and its resource are passed on to the next step.
-
-
Constructor Summary
Constructors Constructor Description FilterEventsWriterStep()Creates a new FilterEventsWriterStep object.FilterEventsWriterStep(IFilterWriter filterWriter)Creates a new FilterEventsWriterStep object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Executes any cleanup code for this step.StringgetDescription()Gets a short localizable description of what this step does.StringgetName()Gets the localizable name of this step.EventhandleEvent(Event event)Processes each event sent though the pipeline.voidsetDocumentRoots(String newDocumentsRoot)Sets the root of the documents to process.voidsetExecutionContext(ExecutionContext context)voidsetFilterConfigurationId(String filterConfigId)voidsetFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)voidsetFilterWriter(IFilterWriter filterWriter)Sets the filter writer for this EventsWriterStep object.voidsetOutputEncoding(String outputEncoding)voidsetOutputStream(OutputStream outputStream)voidsetOutputURI(URI outputURI)voidsetTargetLocale(LocaleId targetLocale)-
Methods inherited from class net.sf.okapi.common.pipeline.BasePipelineStep
cancel, getHelpLocation, getParameters, getSourceLocale, getTargetLocale, handleCustom, handleDocumentPart, handleEndBatch, handleEndBatchItem, handleEndDocument, handleEndGroup, handleEndSubDocument, handleEndSubfilter, handleMultiEvent, handlePipelineParameters, handleRawDocument, handleStartBatch, handleStartBatchItem, handleStartDocument, 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
-
-
-
-
Constructor Detail
-
FilterEventsWriterStep
public FilterEventsWriterStep()
Creates a new FilterEventsWriterStep object. This constructor is needed to be able to instantiate an object from newInstance()
-
FilterEventsWriterStep
public FilterEventsWriterStep(IFilterWriter filterWriter)
Creates a new FilterEventsWriterStep object. This constructor is needed to be able to instantiate an object from newInstance()- Parameters:
filterWriter- the writer used to convert Events to a document
-
-
Method Detail
-
setFilterConfigurationMapper
public void setFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)
-
setFilterConfigurationId
public void setFilterConfigurationId(String filterConfigId)
-
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)
-
setExecutionContext
public void setExecutionContext(ExecutionContext context)
-
setFilterWriter
public void setFilterWriter(IFilterWriter filterWriter)
Sets the filter writer for this EventsWriterStep object.- Parameters:
filterWriter- the filter writer to use.
-
setDocumentRoots
public void setDocumentRoots(String newDocumentsRoot)
Sets the root of the documents to process. This is to be used when creating XLIFF output, as a temporary solution for the 'original' attribute. The value specified is used to fix-up the start document name.- Parameters:
newDocumentsRoot- documents root.
-
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)
Description copied from interface:IPipelineStepProcesses each event sent though the pipeline.- Specified by:
handleEventin interfaceIPipelineStep- Overrides:
handleEventin classBasePipelineStep- Parameters:
event- the event to process.- Returns:
- the event to pass down the pipeline.
-
destroy
public void destroy()
Description copied from interface:IPipelineStepExecutes any cleanup code for this step. Called once at the end of the pipeline lifecycle.- Specified by:
destroyin interfaceIPipelineStep- Overrides:
destroyin classBasePipelineStep
-
-