Class AbstractPipelineComponent
java.lang.Object
org.dbunit.dataset.common.handlers.AbstractPipelineComponent
- All Implemented Interfaces:
Handler,PipelineComponent
- Direct Known Subclasses:
AllHandler,EnforceHandler,EscapeHandler,IsAlnumHandler,NoHandler,QuoteHandler,SeparatorHandler,TransparentHandler,UnquotedFieldAssembler,WhitespacesHandler
Abstract base
PipelineComponent implementation shared by the CSV
field-parsing handlers.- Since:
- 2.2 (Sep 12, 2004)
- Version:
- $Revision$ $Date$
- Author:
- fede, Last changed by: $Author$
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classHelper that forwards the character to its handler'saccept(char)method.protected static classHelper that silently discards the character it is given. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(char c) Method invoked when the character should be acceptedbooleanDetermines whether this handler allows input to end at this point.protected static PipelineComponentcreatePipelineComponent(AbstractPipelineComponent handler, Helper helper) Links the given helper and handler to each other and returns the handler.protected HelperReturns the helper currently handling characters for this component.Returns the pipeline this component belongs to.protected PipelineConfigReturns the configuration of the pipeline this component belongs to.protected PipelineComponentReturns the next component in the pipeline to which unhandled characters are delegated.voidhandle(char c) Handles the given character.voidNotifies this handler that no more input will be provided.voidsetPipeline(Pipeline pipeline) Sets the pipeline this component belongs to.voidsetSuccessor(PipelineComponent successor) Sets the next component to which unhandled characters are delegated.
-
Constructor Details
-
AbstractPipelineComponent
public AbstractPipelineComponent()
-
-
Method Details
-
getSuccessor
Returns the next component in the pipeline to which unhandled characters are delegated.- Returns:
- the successor component, or
nullif none is set.
-
getPipeline
Description copied from interface:PipelineComponentReturns the pipeline this component belongs to.- Specified by:
getPipelinein interfacePipelineComponent- Returns:
- the owning pipeline.
-
setPipeline
Description copied from interface:PipelineComponentSets the pipeline this component belongs to.- Specified by:
setPipelinein interfacePipelineComponent- Parameters:
pipeline- the owning pipeline.
-
getPipelineConfig
Returns the configuration of the pipeline this component belongs to.- Returns:
- the pipeline configuration.
-
setSuccessor
Description copied from interface:PipelineComponentSets the next component to which unhandled characters are delegated.- Specified by:
setSuccessorin interfacePipelineComponent- Parameters:
successor- the successor component.
-
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.
-
noMoreInput
public void noMoreInput()Description copied from interface:HandlerNotifies this handler that no more input will be provided.- Specified by:
noMoreInputin interfaceHandler
-
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.
-
createPipelineComponent
protected static PipelineComponent createPipelineComponent(AbstractPipelineComponent handler, Helper helper) Links the given helper and handler to each other and returns the handler.- Parameters:
handler- the handler component to configure.helper- the helper implementing the handler's character-handling behavior.- Returns:
- the given handler, with its helper set.
-
accept
public void accept(char c) Method invoked when the character should be accepted- Specified by:
acceptin interfacePipelineComponent- Parameters:
c- the character to accept.
-
getHelper
Returns the helper currently handling characters for this component.- Returns:
- the current helper.
-