Class GsonParser


  • class GsonParser
    extends JsonParser
    Low-level JSON serializer implementation based on GSON.

    Implementation is not thread-safe.

    • Field Detail

      • reader

        private final com.google.gson.stream.JsonReader reader
      • currentNameStack

        private java.util.List<java.lang.String> currentNameStack
      • currentToken

        private JsonToken currentToken
      • currentText

        private java.lang.String currentText
    • Constructor Detail

      • GsonParser

        GsonParser​(GsonFactory factory,
                   com.google.gson.stream.JsonReader reader)
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Description copied from class: JsonParser
        Closes the parser and the underlying input stream or reader, and releases any memory associated with it.
        Specified by:
        close in class JsonParser
        Throws:
        java.io.IOException
      • getCurrentName

        public java.lang.String getCurrentName()
        Description copied from class: JsonParser
        Returns the most recent field name or null for array values or for root-level values.
        Specified by:
        getCurrentName in class JsonParser
      • getCurrentToken

        public JsonToken getCurrentToken()
        Description copied from class: JsonParser
        Returns the token the parser currently points to or null for none (at start of input or after end of input).
        Specified by:
        getCurrentToken in class JsonParser
      • getByteValue

        public byte getByteValue()
        Description copied from class: JsonParser
        Returns the byte value of the current token.
        Specified by:
        getByteValue in class JsonParser
      • getShortValue

        public short getShortValue()
        Description copied from class: JsonParser
        Returns the short value of the current token.
        Specified by:
        getShortValue in class JsonParser
      • getIntValue

        public int getIntValue()
        Description copied from class: JsonParser
        Returns the int value of the current token.
        Specified by:
        getIntValue in class JsonParser
      • getFloatValue

        public float getFloatValue()
        Description copied from class: JsonParser
        Returns the float value of the current token.
        Specified by:
        getFloatValue in class JsonParser
      • getBigIntegerValue

        public java.math.BigInteger getBigIntegerValue()
        Description copied from class: JsonParser
        Returns the BigInteger value of the current token.
        Specified by:
        getBigIntegerValue in class JsonParser
      • getDecimalValue

        public java.math.BigDecimal getDecimalValue()
        Description copied from class: JsonParser
        Returns the BigDecimal value of the current token.
        Specified by:
        getDecimalValue in class JsonParser
      • getDoubleValue

        public double getDoubleValue()
        Description copied from class: JsonParser
        Returns the double value of the current token.
        Specified by:
        getDoubleValue in class JsonParser
      • getLongValue

        public long getLongValue()
        Description copied from class: JsonParser
        Returns the long value of the current token.
        Specified by:
        getLongValue in class JsonParser
      • checkNumber

        private void checkNumber()
      • nextToken

        public JsonToken nextToken()
                            throws java.io.IOException
        Description copied from class: JsonParser
        Returns the next token from the stream or null to indicate end of input.
        Specified by:
        nextToken in class JsonParser
        Throws:
        java.io.IOException