57.2.7. 7.セクション
固定長レコードの FIX メッセージでは、ヘッダー、ボディー、およびセクションの情報表現に異なるセクションが含まれるのが一般的です。アノテーション @Section の目的は、モデルのどのクラスがヘッダー(= セクション 1)、ボディー(= セクション 2)、およびフッター(= セクション 3)を表すクラスについて通知することです。
このアノテーションには 1 つの属性/パラメーターのみが存在します。
| アノテーション名 | レコードの種類 | レベル |
|---|---|---|
| セクション | FIX | クラス |
| パラメーター名 | タイプ | 必須/任意 | デフォルト値 | Info |
|---|---|---|---|---|
| number | int | ✓ | セクションの数 |
ケース 1 : セクション
ヘッダーセクションの定義:
FIX Message - セクション - ヘッダー
@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 メッセージ - セクション - ボディー
@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;
フッターセクションの定義:
FIX message - セクション - Footer
@Section(number = 3)
public class Trailer {
@KeyValuePairField(tag = 10, position = 1)
// CheckSum
private int checkSum;
public int getCheckSum() {
return checkSum;
}