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

com.github.mygreen.supercsv.cellprocessor.conversion.Upper Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.3
Show newest version
package com.github.mygreen.supercsv.cellprocessor.conversion;

import org.supercsv.cellprocessor.CellProcessorAdaptor;
import org.supercsv.cellprocessor.ift.StringCellProcessor;
import org.supercsv.util.CsvContext;

/**
 * 大文字に変換するCellProcessor
 * 
 * @since 2.0
 * @author T.TSUCHIE
 *
 */
public class Upper extends CellProcessorAdaptor implements StringCellProcessor {
    
    public Upper() {
        super();
    }
    
    public Upper(final StringCellProcessor next) {
        super(next);
    }
    
    @Override
    public  T execute(final Object value, final CsvContext context) {
        
        if(value == null) {
            return next.execute(value, context);
        }
        
        final String result = value.toString().toUpperCase();
        return next.execute(result, context);
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy