org.apache.thrift.protocol

## Class TJSONProtocol

- java.lang.Object
- - org.apache.thrift.protocol.TProtocol
  - - org.apache.thrift.protocol.TJSONProtocol

-     public class TJSONProtocol
      extends TProtocol

  JSON protocol implementation for thrift. This is a full-featured protocol supporting write and read. Please see the C++ class header for a detailed description of the protocol's wire format.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TJSONProtocol.Factory` Factory for JSON protocol objects
    `protected class` | `TJSONProtocol.JSONBaseContext`
    `protected class` | `TJSONProtocol.JSONListContext`
    `protected class` | `TJSONProtocol.JSONPairContext`
    `protected class` | `TJSONProtocol.LookaheadReader`

  - ### Field Summary

    - ### Fields inherited from class org.apache.thrift.protocol.TProtocol

      `trans_`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TJSONProtocol(TTransport trans)` Constructor

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.nio.ByteBuffer` | `readBinary()`
    `boolean` | `readBool()`
    `byte` | `readByte()`
    `double` | `readDouble()`
    `TField` | `readFieldBegin()`
    `void` | `readFieldEnd()`
    `short` | `readI16()`
    `int` | `readI32()`
    `long` | `readI64()`
    `protected void` | `readJSONSyntaxChar(byte[] b)`
    `TList` | `readListBegin()`
    `void` | `readListEnd()`
    `TMap` | `readMapBegin()`
    `void` | `readMapEnd()`
    `TMessage` | `readMessageBegin()` Reading methods.
    `void` | `readMessageEnd()`
    `TSet` | `readSetBegin()`
    `void` | `readSetEnd()`
    `java.lang.String` | `readString()`
    `TStruct` | `readStructBegin()`
    `void` | `readStructEnd()`
    `void` | `reset()` Reset any internal state back to a blank slate.
    `void` | `writeBinary(java.nio.ByteBuffer bin)`
    `void` | `writeBool(boolean b)`
    `void` | `writeByte(byte b)`
    `void` | `writeDouble(double dub)`
    `void` | `writeFieldBegin(TField field)`
    `void` | `writeFieldEnd()`
    `void` | `writeFieldStop()`
    `void` | `writeI16(short i16)`
    `void` | `writeI32(int i32)`
    `void` | `writeI64(long i64)`
    `void` | `writeListBegin(TList list)`
    `void` | `writeListEnd()`
    `void` | `writeMapBegin(TMap map)`
    `void` | `writeMapEnd()`
    `void` | `writeMessageBegin(TMessage message)` Writing methods.
    `void` | `writeMessageEnd()`
    `void` | `writeSetBegin(TSet set)`
    `void` | `writeSetEnd()`
    `void` | `writeString(java.lang.String str)`
    `void` | `writeStructBegin(TStruct struct)`
    `void` | `writeStructEnd()`

    - ### Methods inherited from class org.apache.thrift.protocol.TProtocol

      `getTransport`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TJSONProtocol

          public TJSONProtocol(TTransport trans)

      Constructor

  - ### Method Detail

    - #### reset

          public void reset()

      Description copied from class: `TProtocol`
      Reset any internal state back to a blank slate. This method only needs to be implemented for stateful protocols.
      Overrides:
        `reset` in class `TProtocol`

    - #### readJSONSyntaxChar

          protected void readJSONSyntaxChar(byte[] b)
                                     throws TException

      Throws:
        `TException`

    - #### writeMessageBegin

          public void writeMessageBegin(TMessage message)
                                 throws TException

      Description copied from class: `TProtocol`
      Writing methods.
      Specified by:
        `writeMessageBegin` in class `TProtocol`
      Throws:
        `TException`

    - #### writeMessageEnd

          public void writeMessageEnd()
                               throws TException

      Specified by:
        `writeMessageEnd` in class `TProtocol`
      Throws:
        `TException`

    - #### writeStructBegin

          public void writeStructBegin(TStruct struct)
                                throws TException

      Specified by:
        `writeStructBegin` in class `TProtocol`
      Throws:
        `TException`

    - #### writeStructEnd

          public void writeStructEnd()
                              throws TException

      Specified by:
        `writeStructEnd` in class `TProtocol`
      Throws:
        `TException`

    - #### writeFieldBegin

          public void writeFieldBegin(TField field)
                               throws TException

      Specified by:
        `writeFieldBegin` in class `TProtocol`
      Throws:
        `TException`

    - #### writeFieldEnd

          public void writeFieldEnd()
                             throws TException

      Specified by:
        `writeFieldEnd` in class `TProtocol`
      Throws:
        `TException`

    - #### writeFieldStop

          public void writeFieldStop()

      Specified by:
        `writeFieldStop` in class `TProtocol`

    - #### writeMapBegin

          public void writeMapBegin(TMap map)
                             throws TException

      Specified by:
        `writeMapBegin` in class `TProtocol`
      Throws:
        `TException`

    - #### writeMapEnd

          public void writeMapEnd()
                           throws TException

      Specified by:
        `writeMapEnd` in class `TProtocol`
      Throws:
        `TException`

    - #### writeListBegin

          public void writeListBegin(TList list)
                              throws TException

      Specified by:
        `writeListBegin` in class `TProtocol`
      Throws:
        `TException`

    - #### writeListEnd

          public void writeListEnd()
                            throws TException

      Specified by:
        `writeListEnd` in class `TProtocol`
      Throws:
        `TException`

    - #### writeSetBegin

          public void writeSetBegin(TSet set)
                             throws TException

      Specified by:
        `writeSetBegin` in class `TProtocol`
      Throws:
        `TException`

    - #### writeSetEnd

          public void writeSetEnd()
                           throws TException

      Specified by:
        `writeSetEnd` in class `TProtocol`
      Throws:
        `TException`

    - #### writeBool

          public void writeBool(boolean b)
                         throws TException

      Specified by:
        `writeBool` in class `TProtocol`
      Throws:
        `TException`

    - #### writeByte

          public void writeByte(byte b)
                         throws TException

      Specified by:
        `writeByte` in class `TProtocol`
      Throws:
        `TException`

    - #### writeI16

          public void writeI16(short i16)
                        throws TException

      Specified by:
        `writeI16` in class `TProtocol`
      Throws:
        `TException`

    - #### writeI32

          public void writeI32(int i32)
                        throws TException

      Specified by:
        `writeI32` in class `TProtocol`
      Throws:
        `TException`

    - #### writeI64

          public void writeI64(long i64)
                        throws TException

      Specified by:
        `writeI64` in class `TProtocol`
      Throws:
        `TException`

    - #### writeDouble

          public void writeDouble(double dub)
                           throws TException

      Specified by:
        `writeDouble` in class `TProtocol`
      Throws:
        `TException`

    - #### writeString

          public void writeString(java.lang.String str)
                           throws TException

      Specified by:
        `writeString` in class `TProtocol`
      Throws:
        `TException`

    - #### writeBinary

          public void writeBinary(java.nio.ByteBuffer bin)
                           throws TException

      Specified by:
        `writeBinary` in class `TProtocol`
      Throws:
        `TException`

    - #### readMessageBegin

          public TMessage readMessageBegin()
                                    throws TException

      Description copied from class: `TProtocol`
      Reading methods.
      Specified by:
        `readMessageBegin` in class `TProtocol`
      Throws:
        `TException`

    - #### readMessageEnd

          public void readMessageEnd()
                              throws TException

      Specified by:
        `readMessageEnd` in class `TProtocol`
      Throws:
        `TException`

    - #### readStructBegin

          public TStruct readStructBegin()
                                  throws TException

      Specified by:
        `readStructBegin` in class `TProtocol`
      Throws:
        `TException`

    - #### readStructEnd

          public void readStructEnd()
                             throws TException

      Specified by:
        `readStructEnd` in class `TProtocol`
      Throws:
        `TException`

    - #### readFieldBegin

          public TField readFieldBegin()
                                throws TException

      Specified by:
        `readFieldBegin` in class `TProtocol`
      Throws:
        `TException`

    - #### readFieldEnd

          public void readFieldEnd()
                            throws TException

      Specified by:
        `readFieldEnd` in class `TProtocol`
      Throws:
        `TException`

    - #### readMapBegin

          public TMap readMapBegin()
                            throws TException

      Specified by:
        `readMapBegin` in class `TProtocol`
      Throws:
        `TException`

    - #### readMapEnd

          public void readMapEnd()
                          throws TException

      Specified by:
        `readMapEnd` in class `TProtocol`
      Throws:
        `TException`

    - #### readListBegin

          public TList readListBegin()
                              throws TException

      Specified by:
        `readListBegin` in class `TProtocol`
      Throws:
        `TException`

    - #### readListEnd

          public void readListEnd()
                           throws TException

      Specified by:
        `readListEnd` in class `TProtocol`
      Throws:
        `TException`

    - #### readSetBegin

          public TSet readSetBegin()
                            throws TException

      Specified by:
        `readSetBegin` in class `TProtocol`
      Throws:
        `TException`

    - #### readSetEnd

          public void readSetEnd()
                          throws TException

      Specified by:
        `readSetEnd` in class `TProtocol`
      Throws:
        `TException`

    - #### readBool

          public boolean readBool()
                           throws TException

      Specified by:
        `readBool` in class `TProtocol`
      Throws:
        `TException`

    - #### readByte

          public byte readByte()
                        throws TException

      Specified by:
        `readByte` in class `TProtocol`
      Throws:
        `TException`

    - #### readI16

          public short readI16()
                        throws TException

      Specified by:
        `readI16` in class `TProtocol`
      Throws:
        `TException`

    - #### readI32

          public int readI32()
                      throws TException

      Specified by:
        `readI32` in class `TProtocol`
      Throws:
        `TException`

    - #### readI64

          public long readI64()
                       throws TException

      Specified by:
        `readI64` in class `TProtocol`
      Throws:
        `TException`

    - #### readDouble

          public double readDouble()
                            throws TException

      Specified by:
        `readDouble` in class `TProtocol`
      Throws:
        `TException`

    - #### readString

          public java.lang.String readString()
                                      throws TException

      Specified by:
        `readString` in class `TProtocol`
      Throws:
        `TException`

    - #### readBinary

          public java.nio.ByteBuffer readBinary()
                                         throws TException

      Specified by:
        `readBinary` in class `TProtocol`
      Throws:
        `TException`