Interface TokenListener

All Known Implementing Classes:
AbstractTokenListener, JsonTokenListener

public interface TokenListener
Callback interface to be implemented by code wanting to decode messages on-the-fly.

If all methods are not required then consider extending AbstractTokenListener for simpler code.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onBeginComposite(Token fieldToken, List<Token> tokens, int fromIndex, int toIndex)
    Beginning of Composite encoded type encountered.
    void
    onBeginGroup(Token token, int groupIndex, int numInGroup)
    Beginning of group encoded type encountered.
    void
    Called on beginning the decoding of a message.
    void
    onBitSet(Token fieldToken, DirectBuffer buffer, int bufferIndex, List<Token> tokens, int fromIndex, int toIndex, int actingVersion)
    BitSet encoded type encountered.
    void
    onEncoding(Token fieldToken, DirectBuffer buffer, int bufferIndex, Token typeToken, int actingVersion)
    Primitive encoded type encountered.
    void
    onEndComposite(Token fieldToken, List<Token> tokens, int fromIndex, int toIndex)
    End of Composite encoded type encountered.
    void
    onEndGroup(Token token, int groupIndex, int numInGroup)
    End of group encoded type encountered.
    void
    Called on end of decoding of a message.
    void
    onEnum(Token fieldToken, DirectBuffer buffer, int bufferIndex, List<Token> tokens, int fromIndex, int toIndex, int actingVersion)
    Enum encoded type encountered.
    void
    onGroupHeader(Token token, int numInGroup)
    Group encountered.
    void
    onVarData(Token fieldToken, DirectBuffer buffer, int bufferIndex, int length, Token typeToken)
    Var data field encountered.
  • Method Details

    • onBeginMessage

      void onBeginMessage(Token token)
      Called on beginning the decoding of a message.
      Parameters:
      token - representing the IR for message including metadata.
    • onEndMessage

      void onEndMessage(Token token)
      Called on end of decoding of a message.
      Parameters:
      token - representing the IR for message including metadata.
    • onEncoding

      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.

      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

      void onEnum(Token fieldToken, DirectBuffer buffer, int bufferIndex, List<Token> tokens, int fromIndex, int toIndex, int actingVersion)
      Enum encoded type encountered.
      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

      void onBitSet(Token fieldToken, DirectBuffer buffer, int bufferIndex, List<Token> tokens, int fromIndex, int toIndex, int actingVersion)
      BitSet encoded type encountered.
      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

      void onBeginComposite(Token fieldToken, List<Token> tokens, int fromIndex, int toIndex)
      Beginning of Composite encoded type encountered.
      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

      void onEndComposite(Token fieldToken, List<Token> tokens, int fromIndex, int toIndex)
      End of Composite encoded type encountered.
      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

      void onGroupHeader(Token token, int numInGroup)
      Group encountered.
      Parameters:
      token - describing the group.
      numInGroup - number of times the group will be repeated.
    • onBeginGroup

      void onBeginGroup(Token token, int groupIndex, int numInGroup)
      Beginning of group encoded type encountered.
      Parameters:
      token - describing the group.
      groupIndex - index for the repeat count of the group.
      numInGroup - number of times the group will be repeated.
    • onEndGroup

      void onEndGroup(Token token, int groupIndex, int numInGroup)
      End of group encoded type encountered.
      Parameters:
      token - describing the group.
      groupIndex - index for the repeat count of the group.
      numInGroup - number of times the group will be repeated.
    • onVarData

      void onVarData(Token fieldToken, DirectBuffer buffer, int bufferIndex, int length, Token typeToken)
      Var data field encountered.
      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.