jp.terasoluna.fw.file.dao.standard
クラス CSVFileLineIterator<T>
java.lang.Object
jp.terasoluna.fw.file.dao.standard.AbstractFileLineIterator<T>
jp.terasoluna.fw.file.dao.standard.VariableFileLineIterator<T>
jp.terasoluna.fw.file.dao.standard.CSVFileLineIterator<T>
- 型パラメータ:
T
- ファイル行オブジェクト。
- すべての実装されたインタフェース:
- Iterator, FileLineIterator<T>
public class CSVFileLineIterator<T>
- extends VariableFileLineIterator<T>
CSVファイル用のファイルアクセス(データ取得)クラス。
CSVファイルからデータを読み込み、1行分のデータをファイル行オブジェクトに格納する。
※利用するファイル行オブジェクトのアノテーション項目
@.@FileFormat
の設定項目
論理項目名 |
物理項目名 |
デフォルト値 |
必須性 |
行区切り文字 |
lineFeedChar |
システムの行区切り文字 |
オプション |
囲み文字 |
encloseChar |
なし(' ') |
オプション |
ファイルエンコーディング |
fileEncodeing |
システムのファイルエンコーディング |
オプション |
ヘッダ行数 |
headerLineCount |
0 |
オプション |
トレイラ行数 |
trailerLineCount |
0 |
オプション |
A.@InputFileColumn
、@OutputFileColumn
の設定項目
論理項目名 |
物理項目名 |
デフォルト値 |
必須性 |
カラムインデックス |
columnIndex |
- |
必須 |
フォーマット |
columnFormat |
"" |
オプション |
バイト長 |
bytes |
- |
必須 |
パディング種別 |
paddingType |
パディングなし |
オプション |
パディング文字 |
paddingChar |
' ' |
オプション |
トリム種別 |
trimType |
トリムなし |
オプション |
トリム文字 |
trimChar |
' ' |
オプション |
文字変換種別 |
stringConverter |
NullStringConverter.class |
オプション |
※注意事項
- 区切り文字を
','以外に設定することは出来ない。(エラー発生)
クラス jp.terasoluna.fw.file.dao.standard.AbstractFileLineIterator から継承されたメソッド |
closeFile, getColumnBytes, getColumnEncloseChar, getCurrentLineCount, getFields, getFileEncoding, getFileName, getHeader, getHeaderLineCount, getLineFeedChar, getTotalBytes, getTrailer, getTrailerLineCount, hasNext, init, isCheckByte, isCheckByte, isCheckColumnAnnotationCount, isCheckEncloseChar, isEnclosed, next, readLine, remove, setLineFeedChar, skip |
クラス java.lang.Object から継承されたメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CSVFileLineIterator
public CSVFileLineIterator(String fileName,
Class<T> clazz,
Map<String,ColumnParser> columnParserMap)
- コンストラクタ。
- パラメータ:
fileName
- ファイル名clazz
- ファイル行結果クラスcolumnParserMap
- カラムフォーマット処理を格納するマップ
Copyright © 2011. All Rights Reserved.