48.10. 7. 섹션
고정 길이 레코드의 FIX 메시지에서는 일반적으로 정보의 표현에 다른 섹션을 갖는 것이 일반적입니다 : 헤더, 본문 및 섹션. 주석 @Section의 목적은 헤더를 나타내는 모델의 클래스(= 섹션 1), body(= 섹션 2) 및 footer(= 섹션 3))에 대해 바인딩을 알리는 것입니다.
이 주석에는 하나의 속성/파라미터만 존재합니다.
| 주석 이름 | 레코드 유형 | level |
|---|---|---|
| 섹션 | FIX | 클래스 |
| 매개변수 이름 | type | 정보 |
|---|---|---|
| number | int | 섹션의 위치를 식별하는 숫자 |
사례 1 : 섹션
header 섹션의 정의
FIX 메시지 - 섹션 - 헤더
@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;
}
본문 섹션의 정의
FIX 메시지 - 섹션 -knative
@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 섹션의 정의
수정 - 섹션 - 섹션
@Section(number = 3)
public class Trailer {
@KeyValuePairField(tag = 10, position = 1)
// CheckSum
private int checkSum;
public int getCheckSum() {
return checkSum;
}