View Javadoc
1   package com.github.mygreen.supercsv.cellprocessor.conversion;
2   
3   import org.supercsv.cellprocessor.CellProcessorAdaptor;
4   import org.supercsv.cellprocessor.ift.StringCellProcessor;
5   import org.supercsv.util.CsvContext;
6   
7   /**
8    * 大文字に変換するCellProcessor
9    * 
10   * @since 2.0
11   * @author T.TSUCHIE
12   *
13   */
14  public class Upper extends CellProcessorAdaptor implements StringCellProcessor {
15      
16      public Upper() {
17          super();
18      }
19      
20      public Upper(final StringCellProcessor next) {
21          super(next);
22      }
23      
24      @Override
25      public <T> T execute(final Object value, final CsvContext context) {
26          
27          if(value == null) {
28              return next.execute(value, context);
29          }
30          
31          final String result = value.toString().toUpperCase();
32          return next.execute(result, context);
33      }
34      
35  }