org.supercsv.ext.builder.CharacterCellProcessorBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of super-csv-annotation Show documentation
Show all versions of super-csv-annotation Show documentation
CSVのJavaライブラリであるSuperCSVに、アノテーション機能を追加したライブラリです。
/*
* CharacterCellProcessorBuilder.java
* created in 2013/03/05
*
* (C) Copyright 2003-2013 GreenDay Project. All rights reserved.
*/
package org.supercsv.ext.builder;
import java.lang.annotation.Annotation;
import org.supercsv.cellprocessor.ParseChar;
import org.supercsv.cellprocessor.ift.CellProcessor;
import org.supercsv.cellprocessor.ift.DoubleCellProcessor;
/**
*
*
* @author T.TSUCHIE
*
*/
public class CharacterCellProcessorBuilder extends AbstractCellProcessorBuilder {
@Override
public CellProcessor buildOutputCellProcessor(final Class type, final Annotation[] annos,
final CellProcessor processor, final boolean ignoreValidationProcessor) {
return processor;
}
@Override
public CellProcessor buildInputCellProcessor(final Class type, final Annotation[] annos,
final CellProcessor processor) {
CellProcessor cellProcessor = processor;
cellProcessor = (cellProcessor == null ? new ParseChar() : new ParseChar((DoubleCellProcessor) cellProcessor));
return cellProcessor;
}
@Override
public Character getParseValue(final Class type, final Annotation[] annos, final String defaultValue) {
return defaultValue.charAt(0);
}
}