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 theIPipelineStep
interface for a step that takes filter events and creates an output document using a providedIFilterWriter
implementation. 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 void
destroy()
Executes any cleanup code for this step.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)
Processes each event sent though the pipeline.void
setDocumentRoots(String newDocumentsRoot)
Sets the root of the documents to process.void
setExecutionContext(ExecutionContext context)
void
setFilterConfigurationId(String filterConfigId)
void
setFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)
void
setFilterWriter(IFilterWriter filterWriter)
Sets the filter writer for this EventsWriterStep object.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, 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:
setTargetLocale
in interfaceIPipelineStep
- Overrides:
setTargetLocale
in 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: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)
Description copied from interface:IPipelineStep
Processes each event sent though the pipeline.- Specified by:
handleEvent
in interfaceIPipelineStep
- Overrides:
handleEvent
in classBasePipelineStep
- Parameters:
event
- the event to process.- Returns:
- the event to pass down the pipeline.
-
destroy
public void destroy()
Description copied from interface:IPipelineStep
Executes any cleanup code for this step. Called once at the end of the pipeline lifecycle.- Specified by:
destroy
in interfaceIPipelineStep
- Overrides:
destroy
in classBasePipelineStep
-
-