Class Pipeline
java.lang.Object
org.dbunit.dataset.common.handlers.Pipeline
- All Implemented Interfaces:
Handler
Chain-of-responsibility pipeline of
PipelineComponents that parses
CSV field text one character at a time.- Since:
- 2.2 (Sep 12, 2004)
- Version:
- $Revision$ $Date$
- Author:
- fede, Last changed by: $Author$
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether this handler allows input to end at this point.booleancanHandle(char c) Determines whether this handler can handle the given character.Returns the piece currently being accumulated.Returns the configuration used by this pipeline's components.Returns the completed pieces produced so far.voidhandle(char c) Handles the given character.voidNotifies this handler that no more input will be provided.voidputFront(PipelineComponent component) Inserts the given component at the front of the pipeline.voidremove(PipelineComponent component) Removes the given component from the pipeline.Removes and returns the component at the front of the pipeline.voidClears the completed pieces produced so far.voidsetCurrentProduct(StringBuilder currentProduct) Sets the piece currently being accumulated.voidsetPipelineConfig(PipelineConfig pipelineConfig) Sets the configuration used by this pipeline's components.protected voidsetProducts(List products) Sets the completed pieces produced so far.voidCompletes the current piece, adding it togetProducts()and starting a new one.
-
Constructor Details
-
Pipeline
public Pipeline()Default constructor.
-
-
Method Details
-
getCurrentProduct
Returns the piece currently being accumulated.- Returns:
- the piece currently being accumulated.
-
setCurrentProduct
Sets the piece currently being accumulated.- Parameters:
currentProduct- the piece currently being accumulated.
-
thePieceIsDone
public void thePieceIsDone()Completes the current piece, adding it togetProducts()and starting a new one. -
getProducts
Returns the completed pieces produced so far.- Returns:
- the completed pieces produced so far.
-
setProducts
Sets the completed pieces produced so far.- Parameters:
products- the completed pieces produced so far.
-
putFront
Inserts the given component at the front of the pipeline.- Parameters:
component- the component to insert.
-
removeFront
Removes and returns the component at the front of the pipeline.- Returns:
- the component that was at the front of the pipeline.
- Throws:
PipelineException- if the front component is the last handler and cannot be removed.
-
remove
Removes the given component from the pipeline.- Parameters:
component- the component to remove.- Throws:
PipelineException- if the component is the last handler, or is not present in the pipeline.
-
canHandle
Description copied from interface:HandlerDetermines whether this handler can handle the given character.- Specified by:
canHandlein interfaceHandler- Parameters:
c- the character to check.- Returns:
trueif this handler can handle the character.- Throws:
IllegalInputCharacterException- if the character is not valid in the current context.
-
handle
Description copied from interface:HandlerHandles the given character.- Specified by:
handlein interfaceHandler- Parameters:
c- the character to handle.- Throws:
IllegalInputCharacterException- if the character is not valid in the current context.PipelineException- if the character cannot be processed by the pipeline.
-
allowForNoMoreInput
public boolean allowForNoMoreInput()Description copied from interface:HandlerDetermines whether this handler allows input to end at this point.- Specified by:
allowForNoMoreInputin interfaceHandler- Returns:
trueif ending input now is allowed.
-
resetProducts
public void resetProducts()Clears the completed pieces produced so far. -
noMoreInput
public void noMoreInput()Description copied from interface:HandlerNotifies this handler that no more input will be provided.- Specified by:
noMoreInputin interfaceHandler
-
getPipelineConfig
Returns the configuration used by this pipeline's components.- Returns:
- the configuration used by this pipeline's components.
-
setPipelineConfig
Sets the configuration used by this pipeline's components.- Parameters:
pipelineConfig- the configuration used by this pipeline's components.
-