Package uk.co.real_logic.sbe.otf
Class AbstractTokenListener
java.lang.Object
uk.co.real_logic.sbe.otf.AbstractTokenListener
- All Implemented Interfaces:
TokenListener
Abstract
TokenListener that can be extended when not all callback methods are required.
By extending this class there is a possibility for the optimizer to elide unused methods otherwise requiring polymorphic dispatch.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonBeginComposite(Token fieldToken, List<Token> tokens, int fromIndex, int toIndex) Beginning of Composite encoded type encountered.voidonBeginGroup(Token token, int groupIndex, int numInGroup) Beginning of group encoded type encountered.voidonBeginMessage(Token token) Called on beginning the decoding of a message.voidonBitSet(Token fieldToken, DirectBuffer buffer, int bufferIndex, List<Token> tokens, int fromIndex, int toIndex, int actingVersion) BitSet encoded type encountered.voidonEncoding(Token fieldToken, DirectBuffer buffer, int bufferIndex, Token typeToken, int actingVersion) Primitive encoded type encountered.voidonEndComposite(Token fieldToken, List<Token> tokens, int fromIndex, int toIndex) End of Composite encoded type encountered.voidonEndGroup(Token token, int groupIndex, int numInGroup) End of group encoded type encountered.voidonEndMessage(Token token) Called on end of decoding of a message.voidonEnum(Token fieldToken, DirectBuffer buffer, int bufferIndex, List<Token> tokens, int fromIndex, int toIndex, int actingVersion) Enum encoded type encountered.voidonGroupHeader(Token token, int numInGroup) Group encountered.voidonVarData(Token fieldToken, DirectBuffer buffer, int bufferIndex, int length, Token typeToken) Var data field encountered.
-
Constructor Details
-
AbstractTokenListener
public AbstractTokenListener()
-
-
Method Details
-
onBeginMessage
Called on beginning the decoding of a message.- Specified by:
onBeginMessagein interfaceTokenListener- Parameters:
token- representing the IR for message including metadata.
-
onEndMessage
Called on end of decoding of a message.- Specified by:
onEndMessagein interfaceTokenListener- Parameters:
token- representing the IR for message including metadata.
-
onEncoding
public void onEncoding(Token fieldToken, DirectBuffer buffer, int bufferIndex, Token typeToken, int actingVersion) Primitive encoded type encountered. This can be a root block field or field within a composite or group.Within a composite the typeToken and fieldToken are the same.
- Specified by:
onEncodingin interfaceTokenListener- Parameters:
fieldToken- in the IR representing the field of the message root or group.buffer- containing the encoded message.bufferIndex- at which the encoded field begins.typeToken- of the encoded primitive value.actingVersion- of the encoded message for determining validity of extension fields.
-
onEnum
public void onEnum(Token fieldToken, DirectBuffer buffer, int bufferIndex, List<Token> tokens, int fromIndex, int toIndex, int actingVersion) Enum encoded type encountered.- Specified by:
onEnumin interfaceTokenListener- Parameters:
fieldToken- in the IR representing the field of the message root or group.buffer- containing the encoded message.bufferIndex- at which the encoded field begins.tokens- describing the message.fromIndex- at which the enum metadata begins.toIndex- at which the enum metadata ends.actingVersion- of the encoded message for determining validity of extension fields.
-
onBitSet
public void onBitSet(Token fieldToken, DirectBuffer buffer, int bufferIndex, List<Token> tokens, int fromIndex, int toIndex, int actingVersion) BitSet encoded type encountered.- Specified by:
onBitSetin interfaceTokenListener- Parameters:
fieldToken- in the IR representing the field of the message root or group.buffer- containing the encoded message.bufferIndex- at which the encoded field begins.tokens- describing the message.fromIndex- at which the bit set metadata begins.toIndex- at which the bit set metadata ends.actingVersion- of the encoded message for determining validity of extension fields.
-
onBeginComposite
Beginning of Composite encoded type encountered.- Specified by:
onBeginCompositein interfaceTokenListener- Parameters:
fieldToken- in the IR representing the field of the message root or group.tokens- describing the message.fromIndex- at which the composite metadata begins.toIndex- at which the composite metadata ends.
-
onEndComposite
End of Composite encoded type encountered.- Specified by:
onEndCompositein interfaceTokenListener- Parameters:
fieldToken- in the IR representing the field of the message root or group.tokens- describing the message.fromIndex- at which the composite metadata begins.toIndex- at which the composite metadata ends.
-
onGroupHeader
Group encountered.- Specified by:
onGroupHeaderin interfaceTokenListener- Parameters:
token- describing the group.numInGroup- number of times the group will be repeated.
-
onBeginGroup
Beginning of group encoded type encountered.- Specified by:
onBeginGroupin interfaceTokenListener- Parameters:
token- describing the group.groupIndex- index for the repeat count of the group.numInGroup- number of times the group will be repeated.
-
onEndGroup
End of group encoded type encountered.- Specified by:
onEndGroupin interfaceTokenListener- Parameters:
token- describing the group.groupIndex- index for the repeat count of the group.numInGroup- number of times the group will be repeated.
-
onVarData
public void onVarData(Token fieldToken, DirectBuffer buffer, int bufferIndex, int length, Token typeToken) Var data field encountered.- Specified by:
onVarDatain interfaceTokenListener- Parameters:
fieldToken- in the IR representing the var data field.buffer- containing the encoded message.bufferIndex- at which the variable data begins.length- of the variable data in bytes.typeToken- of the variable data. Needed to determine character encoding of the variable data.
-