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

public abstract class AbstractPipelineComponent extends Object implements PipelineComponent
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$
  • Constructor Details

    • AbstractPipelineComponent

      public AbstractPipelineComponent()
  • Method Details

    • getSuccessor

      protected PipelineComponent getSuccessor()
      Returns the next component in the pipeline to which unhandled characters are delegated.
      Returns:
      the successor component, or null if none is set.
    • getPipeline

      public Pipeline getPipeline()
      Description copied from interface: PipelineComponent
      Returns the pipeline this component belongs to.
      Specified by:
      getPipeline in interface PipelineComponent
      Returns:
      the owning pipeline.
    • setPipeline

      public void setPipeline(Pipeline pipeline)
      Description copied from interface: PipelineComponent
      Sets the pipeline this component belongs to.
      Specified by:
      setPipeline in interface PipelineComponent
      Parameters:
      pipeline - the owning pipeline.
    • getPipelineConfig

      protected PipelineConfig getPipelineConfig()
      Returns the configuration of the pipeline this component belongs to.
      Returns:
      the pipeline configuration.
    • setSuccessor

      public void setSuccessor(PipelineComponent successor)
      Description copied from interface: PipelineComponent
      Sets the next component to which unhandled characters are delegated.
      Specified by:
      setSuccessor in interface PipelineComponent
      Parameters:
      successor - the successor component.
    • handle

      public void handle(char c) throws IllegalInputCharacterException, PipelineException
      Description copied from interface: Handler
      Handles the given character.
      Specified by:
      handle in interface Handler
      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: Handler
      Notifies this handler that no more input will be provided.
      Specified by:
      noMoreInput in interface Handler
    • allowForNoMoreInput

      public boolean allowForNoMoreInput()
      Description copied from interface: Handler
      Determines whether this handler allows input to end at this point.
      Specified by:
      allowForNoMoreInput in interface Handler
      Returns:
      true if 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:
      accept in interface PipelineComponent
      Parameters:
      c - the character to accept.
    • getHelper

      protected Helper getHelper()
      Returns the helper currently handling characters for this component.
      Returns:
      the current helper.