Class XPipelineStep
- java.lang.Object
-
- net.sf.okapi.common.pipelinebuilder.XPipelineStep
-
- All Implemented Interfaces:
AutoCloseable,Function<Stream<Event>,Stream<Event>>,IPipelineStep
public class XPipelineStep extends Object implements IPipelineStep
-
-
Constructor Summary
Constructors Constructor Description XPipelineStep(Class<? extends IPipelineStep> stepClass, URL parametersURL, boolean ignoreErrors)XPipelineStep(Class<? extends IPipelineStep> stepClass, IParameters parameters)XPipelineStep(Class<? extends IPipelineStep> stepClass, XParameter... parameters)XPipelineStep(IPipelineStep step)XPipelineStep(IPipelineStep step, URL parametersURL, boolean ignoreErrors)XPipelineStep(IPipelineStep step, IParameters parameters)XPipelineStep(IPipelineStep step, XParameter... parameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Cancel processing on this pipeline.voiddestroy()Executes any cleanup code for this step.StringgetDescription()Gets a short localizable description of what this step does.StringgetHelpLocation()Gets the relative directory location for the help of this step.StringgetName()Gets the localizable name of this step.IParametersgetParameters()Gets the current parameters for this step.IPipelineStepgetStep()EventhandleEvent(Event event)Processes each event sent though the pipeline.booleanisDone()booleanisLastOutputStep()Is this step the last step with output in the pipeline?voidsetLastOutputStep(boolean isLastStep)Tell the step if it is the last one on the pipeline with output.voidsetParameters(IParameters params)Sets new parameters for this step.-
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, getSourceLocale, getTargetLocale, handleStream, setSourceLocale, setTargetLocale
-
-
-
-
Constructor Detail
-
XPipelineStep
public XPipelineStep(IPipelineStep step, IParameters parameters)
-
XPipelineStep
public XPipelineStep(IPipelineStep step)
-
XPipelineStep
public XPipelineStep(IPipelineStep step, XParameter... parameters)
-
XPipelineStep
public XPipelineStep(Class<? extends IPipelineStep> stepClass, IParameters parameters)
-
XPipelineStep
public XPipelineStep(Class<? extends IPipelineStep> stepClass, XParameter... parameters)
-
XPipelineStep
public XPipelineStep(IPipelineStep step, URL parametersURL, boolean ignoreErrors)
-
XPipelineStep
public XPipelineStep(Class<? extends IPipelineStep> stepClass, URL parametersURL, boolean ignoreErrors)
-
-
Method Detail
-
getDescription
public String getDescription()
Description copied from interface:IPipelineStepGets a short localizable description of what this step does.- Specified by:
getDescriptionin interfaceIPipelineStep- Returns:
- the text of a short description of what this step does.
-
getName
public String getName()
Description copied from interface:IPipelineStepGets the localizable name of this step.- Specified by:
getNamein interfaceIPipelineStep- Returns:
- the localizable name of this step.
-
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
-
getHelpLocation
public String getHelpLocation()
Description copied from interface:IPipelineStepGets the relative directory location for the help of this step. The main help file for the step must be at that location and its name must be the name of the class implementing the step in lowercase with a .html extension.- Specified by:
getHelpLocationin interfaceIPipelineStep- Returns:
- the relative directory location for the help of this step.
-
getParameters
public IParameters getParameters()
Description copied from interface:IPipelineStepGets the current parameters for this step.- Specified by:
getParametersin interfaceIPipelineStep- Returns:
- the current parameters for this step or null if there are no parameters.
-
handleEvent
public Event handleEvent(Event event)
Description copied from interface:IPipelineStepProcesses each event sent though the pipeline.- Specified by:
handleEventin interfaceIPipelineStep- Parameters:
event- the event to process.- Returns:
- the event to pass down the pipeline.
-
isDone
public boolean isDone()
Description copied from interface:IPipelineStepSteps that can generateEvents such asIFilters return false until no more events can be created. Steps which do not createEvents always return true.- Specified by:
isDonein interfaceIPipelineStep- Returns:
- false if can generate more events, true otherwise.
-
isLastOutputStep
public boolean isLastOutputStep()
Description copied from interface:IPipelineStepIs this step the last step with output in the pipeline?- Specified by:
isLastOutputStepin interfaceIPipelineStep- Returns:
- true if last step with output, false otherwise.
-
setLastOutputStep
public void setLastOutputStep(boolean isLastStep)
Description copied from interface:IPipelineStepTell the step if it is the last one on the pipeline with output.- Specified by:
setLastOutputStepin interfaceIPipelineStep- Parameters:
isLastStep- true if last step with output, false otherwise.
-
setParameters
public void setParameters(IParameters params)
Description copied from interface:IPipelineStepSets new parameters for this step.- Specified by:
setParametersin interfaceIPipelineStep- Parameters:
params- the new parameters to use.
-
getStep
public IPipelineStep getStep()
-
cancel
public void cancel()
Description copied from interface:IPipelineStepCancel processing on this pipeline. EachIPipelineStepis responsible to implement a cancel method that will interrupt long running operations- Specified by:
cancelin interfaceIPipelineStep
-
-