1 21 22 package org.dbunit.dataset.csv.handlers; 23 24 import org.dbunit.dataset.csv.IllegalInputCharacterException; 25 26 public class SeparatorHandler extends AbstractPipelineComponent { 27 28 private SeparatorHandler() {} 29 30 public static final PipelineComponent ACCEPT () { 31 return createPipelineComponent(new SeparatorHandler(), new ACCEPT()); 32 } 33 34 public static final PipelineComponent IGNORE () { 35 return createPipelineComponent(new SeparatorHandler(), new IGNORE()); 36 } 37 38 public static final PipelineComponent ENDPIECE () { 39 return createPipelineComponent(new SeparatorHandler(), new ENDPIECE()); 40 } 41 42 public static final char SEPARATOR_CHAR = ','; 43 44 public boolean canHandle(char c) throws IllegalInputCharacterException { 45 if (c == SEPARATOR_CHAR) { 46 return true; 47 } 48 return false; } 50 51 static protected class ENDPIECE extends Helper { 52 void helpWith(char c) throws PipelineException { 53 getHandler().getPipeline().thePieceIsDone(); 55 } 56 } 57 58 } 59 | Popular Tags |