T - マッピング対象のBeanのクラスタイプpublic class LazyCsvAnnotationBeanWriter<T> extends AbstractCsvAnnotationBeanWriter<T>
カラム番号が指定されていないBean定義を元にマッピングします。
beanMappingCache, beanValues, cache, errorMessages, exceptionConverter, processedColumns, validators| コンストラクタと説明 |
|---|
LazyCsvAnnotationBeanWriter(BeanMapping<T> beanMapping,
Writer writer,
CsvPreference preference,
Class<?>... groups)
Beanのマッピング情報を指定して、
LazyCsvAnnotationBeanWriterを作成するコンストラクタ。 |
LazyCsvAnnotationBeanWriter(Class<T> beanType,
Writer writer,
CsvPreference preference,
Class<?>... groups)
Beanのクラスタイプを指定して、
LazyCsvAnnotationBeanWriterを作成するコンストラクタ。 |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
BeanMapping<T> |
getBeanMapping()
Beanのマッピング情報を取得します。
|
String[] |
getDefinedHeader()
Beanクラスを元に作成したヘッダー情報を取得する。
|
void |
init()
ヘッダー情報を指定しないで初期化を行います。
|
void |
init(String... headers)
ヘッダー情報を指定して初期化を行います。
|
void |
write(T source)
レコードを書き込みます。
|
void |
writeAll(Collection<T> sources)
レコードのデータを全て書き込みます。
|
void |
writeAll(Collection<T> sources,
boolean continueOnError)
レコードのデータを全て書き込みます。
|
void |
writeHeader()
ヘッダー情報を書き出します。
|
addValidator, executeCellProcessors, executeNonCellProcessor, extractBeanValues, getErrorMessages, getExceptionConverter, getValidators, processErrors, setExceptionConverter, writeclose, flush, getLineNumber, getRowNumber, incrementRowAndLineNo, writeComment, writeHeader, writeRow, writeRow, writeRowpublic LazyCsvAnnotationBeanWriter(Class<T> beanType, Writer writer, CsvPreference preference, Class<?>... groups)
LazyCsvAnnotationBeanWriterを作成するコンストラクタ。
BufferedWriterにラップして実行されるため、ラップする必要はありません。
beanType - Beanのクラスタイプ。writer - the writerpreference - CSV preferences.groups - グループ情報。適用するアノテーションを切り替える際に指定します。NullPointerException - if beanType or writer or preferences are null.public LazyCsvAnnotationBeanWriter(BeanMapping<T> beanMapping, Writer writer, CsvPreference preference, Class<?>... groups)
LazyCsvAnnotationBeanWriterを作成するコンストラクタ。
BufferedWriterにラップして実行されるため、ラップする必要はありません。
Beanのマッピング情報を独自にカスタマイズして、LazyBeanMappingFactoryから作成する場合に利用します。
beanMapping - Beanのマッピング情報。writer - the writerpreference - the CSV preferences.NullPointerException - if beanMapping or writer or preferences are null.public void init()
カラム番号が指定されていないカラムは、フィールドの名称順に空いている番号が割り振られます。
public void init(String... headers)
カラム番号が指定されていないカラムは、フィールドの名称順に空いている番号が割り振られます。
headers - ヘッダー情報public void writeHeader()
throws IOException
ただし、列番号を省略され、定義がされていないカラムは、column[カラム番号]の形式となります。
IOException - ファイルの出力に失敗した場合。IllegalStateException - init() メソッドによる初期化が完了していない場合public void writeAll(Collection<T> sources) throws IOException
ヘッダー行も自動的に処理されます。2回目以降に呼び出した場合、ヘッダー情報は書き込まれません。
レコード処理中に例外が発生した場合、その時点で処理を終了します。
sources - 書き込むレコードのデータ。NullPointerException - sources is null.IOException - レコードの出力に失敗した場合。SuperCsvBindingException - セルの値に問題がある場合SuperCsvException - 設定など、その他に問題がある場合public void writeAll(Collection<T> sources, boolean continueOnError) throws IOException
ヘッダー行も自動的に処理されます。2回目以降に呼び出した場合、ヘッダー情報は書き込まれません。
sources - 書き込むレコードのデータ。continueOnError - continueOnError レコードの処理中に、
例外SuperCsvBindingExceptionが発生しても、続行するかどうか指定します。
trueの場合、例外が発生しても、次の処理を行います。NullPointerException - sources is null.IOException - レコードの出力に失敗した場合。SuperCsvBindingException - セルの値に問題がある場合SuperCsvException - 設定など、その他に問題がある場合public void write(T source) throws IOException
write クラス内 AbstractCsvAnnotationBeanWriter<T>source - 書き込むレコード。IllegalStateException - init() メソッドによる初期化が完了していない場合IOException - レコードの出力に失敗した場合。public String[] getDefinedHeader()
ただし、列番号を省略され、定義がされていないカラムは、column[カラム番号]の形式となります。
getDefinedHeader クラス内 AbstractCsvAnnotationBeanWriter<T>IllegalStateException - init() メソッドによる初期化が完了していない場合public BeanMapping<T> getBeanMapping()
getBeanMapping クラス内 AbstractCsvAnnotationBeanWriter<T>IllegalStateException - init() メソッドによる初期化が完了していない場合Copyright © 2025 mygreen. All rights reserved.