All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.supercsv.ext.builder.CharacterCellProcessorBuilder Maven / Gradle / Ivy

Go to download

CSVのJavaライブラリであるSuperCSVに、アノテーション機能を追加したライブラリです。

There is a newer version: 2.3
Show newest version
/*
 * 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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy