46.9. 7.セクション
固定長レコードの FIX メッセージでは、一般的には : ヘッダー、ボディー、およびセクションの情報を表すセクションが異なります。@Section アノテーションの目的は、モデルのどのクラスがヘッダー(= セクション 1)、本文(= セクション 2)、フッター(= セクション 3)を表すことにあります。
このアノテーションには 1 つの属性/パラメーターのみが存在します。
| アノテーション名 | レコードタイプ | レベル |
|---|---|---|
| セクション | FIX | クラス |
| パラメーター名 | type | Info |
|---|---|---|
| number | int | セクションの位置を特定する数字 |
ケース 1: セクション
ヘッダーセクションの定義
FIX message - Section - Header
@Section(number = 1)
public class Header {
@KeyValuePairField(tag = 8, position = 1) // Message Header
private String beginString;
@KeyValuePairField(tag = 9, position = 2) // Checksum
private int bodyLength;
}
body セクションの定義
FIX message - Section - Body
@Section(number = 2)
@Message(keyValuePairSeparator = "=", pairSeparator = "\\u0001", type = "FIX", version = "4.1", isOrdered = true)
public class Order {
@Link Header header;
@Link Trailer trailer;
@KeyValuePairField(tag = 1, position = 1) // Client reference
private String account;
@KeyValuePairField(tag = 11, position = 3) // Order reference
private String clOrdId;
footer セクションの定義
FIX message - Section - Footer
@Section(number = 3)
public class Trailer {
@KeyValuePairField(tag = 10, position = 1)
// CheckSum
private int checkSum;
public int getCheckSum() {
return checkSum;
}