Skip to content

Commit 5eb0cfc

Browse files
committed
[Java]: Added javadoc to OTF TokenListener.
1 parent 1bf840c commit 5eb0cfc

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

main/java/uk/co/real_logic/sbe/otf/TokenListener.java

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,118 @@
2020

2121
import java.util.List;
2222

23+
/**
24+
* Callback interface to be implemented by code wanting to decode messages on-the-fly.
25+
* <p/>
26+
* If all methods are not required then consider extending {@link AbstractTokenListener} for potential performance benefits and simpler code.
27+
*/
2328
public interface TokenListener
2429
{
30+
/**
31+
* Called on beginning the decoding of a message.
32+
*
33+
* @param token representing the IR for message including meta data.
34+
*/
2535
void onBeginMessage(Token token);
2636

37+
/**
38+
* Called on end of decoding of a message.
39+
*
40+
* @param token representing the IR for message including meta data.
41+
*/
2742
void onEndMessage(Token token);
2843

44+
/**
45+
* Primitive encoded type encountered. This can be a root block field or field within a composite or group.
46+
* <p/>
47+
* Within a composite the typeToken and fieldToken are the same.
48+
*
49+
* @param fieldToken in the IR representing the field of the message root or group.
50+
* @param buffer containing the encoded message.
51+
* @param bufferIndex at which the encoded field begins.
52+
* @param typeToken of the encoded primitive value.
53+
* @param actingVersion of the encoded message for determining validity of extension fields.
54+
*/
2955
void onEncoding(Token fieldToken, DirectBuffer buffer, int bufferIndex, Token typeToken, int actingVersion);
3056

57+
/**
58+
* Enum encoded type encountered.
59+
*
60+
* @param fieldToken in the IR representing the field of the message root or group.
61+
* @param buffer containing the encoded message.
62+
* @param bufferIndex at which the encoded field begins.
63+
* @param tokens describing the message.
64+
* @param fromIndex at which the enum metadata begins.
65+
* @param toIndex at which the enum metadata ends.
66+
* @param actingVersion of the encoded message for determining validity of extension fields.
67+
*/
3168
void onEnum(Token fieldToken,
3269
DirectBuffer buffer, int bufferIndex,
3370
List<Token> tokens, int fromIndex, int toIndex,
3471
int actingVersion);
3572

73+
/**
74+
* BitSet encoded type encountered.
75+
*
76+
* @param fieldToken in the IR representing the field of the message root or group.
77+
* @param buffer containing the encoded message.
78+
* @param bufferIndex at which the encoded field begins.
79+
* @param tokens describing the message.
80+
* @param fromIndex at which the bit set metadata begins.
81+
* @param toIndex at which the bit set metadata ends.
82+
* @param actingVersion of the encoded message for determining validity of extension fields.
83+
*/
3684
void onBitSet(Token fieldToken,
3785
DirectBuffer buffer, int bufferIndex,
3886
List<Token> tokens, int fromIndex, int toIndex,
3987
int actingVersion);
4088

89+
/**
90+
* Beginning of Composite encoded type encountered.
91+
*
92+
* @param fieldToken in the IR representing the field of the message root or group.
93+
* @param tokens describing the message.
94+
* @param fromIndex at which the composite metadata begins.
95+
* @param toIndex at which the composite metadata ends.
96+
*/
4197
void onBeginComposite(Token fieldToken, List<Token> tokens, int fromIndex, int toIndex);
4298

99+
/**
100+
* End of Composite encoded type encountered.
101+
*
102+
* @param fieldToken in the IR representing the field of the message root or group.
103+
* @param tokens describing the message.
104+
* @param fromIndex at which the composite metadata begins.
105+
* @param toIndex at which the composite metadata ends.
106+
*/
43107
void onEndComposite(Token fieldToken, List<Token> tokens, int fromIndex, int toIndex);
44108

109+
/**
110+
* Beginning of group encoded type encountered.
111+
*
112+
* @param token describing the group.
113+
* @param groupIndex index for the repeat count of the group.
114+
* @param numInGroup number of times the group will be repeated.
115+
*/
45116
void onBeginGroup(Token token, int groupIndex, int numInGroup);
46117

118+
/**
119+
* End of group encoded type encountered.
120+
*
121+
* @param token describing the group.
122+
* @param groupIndex index for the repeat count of the group.
123+
* @param numInGroup number of times the group will be repeated.
124+
*/
47125
void onEndGroup(Token token, int groupIndex, int numInGroup);
48126

127+
/**
128+
* Var data field encountered.
129+
*
130+
* @param fieldToken in the IR representing the var data field.
131+
* @param buffer containing the encoded message.
132+
* @param bufferIndex at which the variable data begins.
133+
* @param length of the variable data in bytes.
134+
* @param typeToken of the variable data. Specifically needed to determine character encoding of the variable data.
135+
*/
49136
void onVarData(Token fieldToken, DirectBuffer buffer, int bufferIndex, int length, Token typeToken);
50137
}

0 commit comments

Comments
 (0)