Class EnforceHandler

java.lang.Object
org.dbunit.dataset.common.handlers.AbstractPipelineComponent
org.dbunit.dataset.common.handlers.EnforceHandler
All Implemented Interfaces:
Handler, PipelineComponent

public class EnforceHandler extends AbstractPipelineComponent
Pipeline component that delegates to the first wrapped PipelineComponent able to handle a character, throwing IllegalInputCharacterException if none of them can.
Since:
2.2 (Sep 12, 2004)
Version:
$Revision$ $Date$
Author:
fede, Last changed by: $Author$
  • Method Details

    • ENFORCE

      public static final PipelineComponent ENFORCE(PipelineComponent component)
      Creates a handler that enforces the given component to handle the character.
      Parameters:
      component - the component that must handle the character.
      Returns:
      the new pipeline component.
    • ENFORCE

      public static final PipelineComponent ENFORCE(PipelineComponent[] components)
      Creates a handler that enforces the first of the given components able to handle the character.
      Parameters:
      components - the components, tried in order, one of which must handle the character.
      Returns:
      the new pipeline component.
    • canHandle

      public boolean canHandle(char c) throws IllegalInputCharacterException
      Description copied from interface: Handler
      Determines whether this handler can handle the given character.
      Parameters:
      c - the character to check.
      Returns:
      true if this handler can handle the character.
      Throws:
      IllegalInputCharacterException - if the character is not valid in the current context.
    • setPipeline

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

      protected PipelineComponent[] getEnforcedComponents()
      Returns the components tried, in order, to handle a character.
      Returns:
      the components tried, in order, to handle a character.
    • setEnforcedComponents

      protected void setEnforcedComponents(PipelineComponent[] enforcedComponents)
      Sets the components tried, in order, to handle a character.
      Parameters:
      enforcedComponents - the components tried, in order, to handle a character.