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

org.supercsv.ext.cellprocessor.ift.ValidationCellProcessor Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.3
Show newest version
package org.supercsv.ext.cellprocessor.ift;

import java.util.Map;


/**
 * Validation系のCellProcessor.
 * 

エラー時のメッセージ出力する場合に、このインタフェースを実装する。

* * @author T.TSUCHIE * */ public interface ValidationCellProcessor { /** * メッセージのコードを取得する。 *

基本は、{@literal + ".violated"} *

例. org.supercsv.contrib.cellprocessor.constraint.StrMax.violated * @return */ default String getMessageCode() { return this.getClass().getCanonicalName() + ".violated"; } /** * メッセージ用の変数を取得する。 *

Map.key = message variable key *

Map.value = message variable value *

ex.{@literal CellProcessor:NumberRange, Map.key = max, Map.vale = 5.} * @return */ Map getMessageVariable(); /** * メッセージに埋め込む際の値を取得する。 *

java.util.Date型の時など、表記とそぐわない場合があるため。 * @param value フォーマット対象の値。 * @return フォーマットした値。 */ default String formatValue(final Object value) { if(value == null) { return ""; } return value.toString(); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy