FileWriterPattern パターンは、ファイルにテキスト・データを書き込む場合に使用されます。
プロパティー名 | 値 |
---|---|
PATTERN_IMPL_CLASS | FileWriterPattern インターフェースを実装するクラス |
FILENAME | 入力ファイルの完全なパス |
プロパティー名 | 値 | 説明 |
---|---|---|
debug |
true または false (デフォルトは false) |
このバッチ・データ・ストリームに対する詳細トレースを使用可能にします。 |
EnablePerformanceMeasurement |
true または false (デフォルトは false) |
GenericXDBatchStep を使用している場合に、バッチ・データ・ストリームおよび processRecord メソッドにかかった合計時間を計算します。 |
EnableDetailedPerformanceMeasurement |
true または false (デフォルトは false) |
バッチ・データ・ストリームの各メソッドにかかった時間の詳細を提供します。 |
file.encoding |
ファイルのエンコード |
例えば、8859_1 など。 |
AppendJobldToFileName |
true または false (デフォルトは false) |
ファイルのロード前にジョブ ID をファイル名に追加します。 |
public interface FileWriterPattern { /** * Invoked during step setup phase * @param props */ public void initialize(Properties props); /** * This method should write the given record * object to the bufferedwriter. * @param out * @param record * @throws IOException */ public void writeRecord(BufferedWriter out, Object record) throws IOException; /** * This method is invoked only once just after the bufferedwriter * is opened. It should be used to write any header information * @param out * @throws IOException */ public void writeHeader(BufferedWriter out) throws IOException; /** * This method can be optionally called during process step to explicity * initialize and write the header. * @param header * @throws IOException */ public void writeHeader(BufferedWriter out, Object header) throws IOException; }
<batch-data-streams> <bds> <logical-name>outputStream</logical-name> <props> <prop name="PATTERN_IMPL_CLASS" value="com.ibm.websphere.batch.samples.tests.bds.EchoWriter"/> <prop name="file.encoding" value="8859_1"/> <prop name="FILENAME" value="/opt/txlist.txt" /> <prop name="debug" value="true"/> </props> <impl-class>com.ibm.websphere.batch.devframework.datastreams.patterns.TextFileWriter</impl-class> </bds> </batch-data-streams>