Class TTextProtocol

java.lang.Object
org.apache.thrift.protocol.TProtocol
com.linecorp.armeria.common.thrift.text.TTextProtocol

@Deprecated
public final class TTextProtocol
extends TProtocol
A simple text format for serializing/deserializing thrift messages. This format is inefficient in space.

For an example, see: tests/resources/com/twitter/common/thrift/text/TTextProtocol_TestData.txt

which is a text encoding of the thrift message defined in:

src/main/thrift/com/twitter/common/thrift/text/TTextProtocolTest.thrift

Whitespace (including newlines) is not significant.

No comments are allowed in the json.

Messages must be formatted as a JSON object with a field 'method' containing the message name, 'type' containing the message type as an uppercase string corresponding to TMessageType, 'args' containing a JSON object with the actual arguments, and an optional 'seqid' field containing the sequence id. If 'seqid' is not provided, it will be treated as 0. 'args' should use the argument names as defined in the service definition.

Example: { "method": "GetItem", "type": "CALL", "args": { "id": 1, "fetchAll": true }, "seqid": 100 }

TODO(Alex Roetter): write a wrapper that allows us to read in a file of many structs (perhaps stored in a JsonArray), passing each struct to this class for parsing.

See thrift's @see org.apache.thrift.protocol.TJSONProtocol for another example an implementation of the @see TProtocol interface. This class is based on that.

TODO(Alex Roetter): Also add a new TEXT_PROTOCOL field to ThriftCodec

TODO: Support map enum keys specified as strings.

TODO: Support string values for enums that have been typedef'd.