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

com.github.mygreen.supercsv.io.BeanMappingCache Maven / Gradle / Ivy

Go to download

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

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

import org.supercsv.cellprocessor.ift.CellProcessor;

import com.github.mygreen.supercsv.builder.BeanMapping;


/**
 * Beanのマッピング情報のキャッシュ。
 * 

レコードの実行ごとに、

* * @version 2.0 * @author T.TSUCHIE * */ public class BeanMappingCache { private final BeanMapping beanMapping; private String[] header; private String[] nameMapping; private CellProcessor[] cellProcessorsForReading; private CellProcessor[] cellProcessorsForWriting; private BeanMappingCache(final BeanMapping beanMapping) { this.beanMapping = beanMapping; } public static BeanMappingCache create(final BeanMapping beanMapping) { final BeanMappingCache cache = new BeanMappingCache<>(beanMapping); cache.header = beanMapping.getHeader(); cache.nameMapping = beanMapping.getNameMapping(); cache.cellProcessorsForReading = beanMapping.getCellProcessorsForReading(); cache.cellProcessorsForWriting = beanMapping.getCellProcessorsForWriting(); return cache; } /** * キャッシュ元のデータを取得する。 * @return キャッシュ元となったマッピング情報。 */ public BeanMapping getOriginal() { return beanMapping; } public String[] getHeader() { return header; } public String[] getNameMapping() { return nameMapping; } public CellProcessor[] getCellProcessorsForReading() { return cellProcessorsForReading; } public CellProcessor[] getCellProcessorsForWriting() { return cellProcessorsForWriting; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy