com.google.api.client.testing.http.json
Class MockJsonGenerator

java.lang.Object
  extended by com.google.api.client.json.JsonGenerator
      extended by com.google.api.client.testing.http.json.MockJsonGenerator

public class MockJsonGenerator
extends JsonGenerator

Mock for JsonGenerator.

Implementation is thread-safe.

Since:
1.11
Author:
[email protected] (Ravi Mistry)

Method Summary
 void close()
          Closes the serializer and the underlying output stream or writer, and releases any memory associated with it.
 void flush()
          Flushes any buffered content to the underlying output stream or writer.
 JsonFactory getFactory()
          Returns the JSON factory from which this generator was created.
 void writeBoolean(boolean state)
          Writes a literal JSON boolean value ('true' or 'false').
 void writeEndArray()
          Writes a JSON end array character ']'.
 void writeEndObject()
          Writes a JSON end object character '}'.
 void writeFieldName(String name)
          Writes a JSON quoted field name.
 void writeNull()
          Writes a literal JSON null value.
 void writeNumber(BigDecimal v)
          Writes a JSON big decimal value.
 void writeNumber(BigInteger v)
          Writes a JSON big integer value.
 void writeNumber(double v)
          Writes a JSON double value.
 void writeNumber(float v)
          Writes a JSON float value.
 void writeNumber(int v)
          Writes a JSON int value.
 void writeNumber(long v)
          Writes a JSON long value.
 void writeNumber(String encodedValue)
          Writes a JSON numeric value that has already been encoded properly.
 void writeNumber(com.google.common.primitives.UnsignedInteger v)
          Writes a JSON unsigned integer value.
 void writeNumber(com.google.common.primitives.UnsignedLong v)
          Writes a JSON unsigned long value.
 void writeStartArray()
          Writes a JSON start array character '['.
 void writeStartObject()
          Writes a JSON start object character '{'.
 void writeString(String value)
          Writes a JSON quoted string value.
 
Methods inherited from class com.google.api.client.json.JsonGenerator
enablePrettyPrint, serialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFactory

public JsonFactory getFactory()
Description copied from class: JsonGenerator
Returns the JSON factory from which this generator was created.

Specified by:
getFactory in class JsonGenerator

flush

public void flush()
           throws IOException
Description copied from class: JsonGenerator
Flushes any buffered content to the underlying output stream or writer.

Specified by:
flush in class JsonGenerator
Throws:
IOException

close

public void close()
           throws IOException
Description copied from class: JsonGenerator
Closes the serializer and the underlying output stream or writer, and releases any memory associated with it.

Specified by:
close in class JsonGenerator
Throws:
IOException

writeStartArray

public void writeStartArray()
                     throws IOException
Description copied from class: JsonGenerator
Writes a JSON start array character '['.

Specified by:
writeStartArray in class JsonGenerator
Throws:
IOException

writeEndArray

public void writeEndArray()
                   throws IOException
Description copied from class: JsonGenerator
Writes a JSON end array character ']'.

Specified by:
writeEndArray in class JsonGenerator
Throws:
IOException

writeStartObject

public void writeStartObject()
                      throws IOException
Description copied from class: JsonGenerator
Writes a JSON start object character '{'.

Specified by:
writeStartObject in class JsonGenerator
Throws:
IOException

writeEndObject

public void writeEndObject()
                    throws IOException
Description copied from class: JsonGenerator
Writes a JSON end object character '}'.

Specified by:
writeEndObject in class JsonGenerator
Throws:
IOException

writeFieldName

public void writeFieldName(String name)
                    throws IOException
Description copied from class: JsonGenerator
Writes a JSON quoted field name.

Specified by:
writeFieldName in class JsonGenerator
Throws:
IOException

writeNull

public void writeNull()
               throws IOException
Description copied from class: JsonGenerator
Writes a literal JSON null value.

Specified by:
writeNull in class JsonGenerator
Throws:
IOException

writeString

public void writeString(String value)
                 throws IOException
Description copied from class: JsonGenerator
Writes a JSON quoted string value.

Specified by:
writeString in class JsonGenerator
Throws:
IOException

writeBoolean

public void writeBoolean(boolean state)
                  throws IOException
Description copied from class: JsonGenerator
Writes a literal JSON boolean value ('true' or 'false').

Specified by:
writeBoolean in class JsonGenerator
Throws:
IOException

writeNumber

public void writeNumber(int v)
                 throws IOException
Description copied from class: JsonGenerator
Writes a JSON int value.

Specified by:
writeNumber in class JsonGenerator
Throws:
IOException

writeNumber

public void writeNumber(long v)
                 throws IOException
Description copied from class: JsonGenerator
Writes a JSON long value.

Specified by:
writeNumber in class JsonGenerator
Throws:
IOException

writeNumber

public void writeNumber(BigInteger v)
                 throws IOException
Description copied from class: JsonGenerator
Writes a JSON big integer value.

Specified by:
writeNumber in class JsonGenerator
Throws:
IOException

writeNumber

public void writeNumber(com.google.common.primitives.UnsignedInteger v)
                 throws IOException
Description copied from class: JsonGenerator
Writes a JSON unsigned integer value.

Specified by:
writeNumber in class JsonGenerator
Throws:
IOException

writeNumber

public void writeNumber(com.google.common.primitives.UnsignedLong v)
                 throws IOException
Description copied from class: JsonGenerator
Writes a JSON unsigned long value.

Specified by:
writeNumber in class JsonGenerator
Throws:
IOException

writeNumber

public void writeNumber(float v)
                 throws IOException
Description copied from class: JsonGenerator
Writes a JSON float value.

Specified by:
writeNumber in class JsonGenerator
Throws:
IOException

writeNumber

public void writeNumber(double v)
                 throws IOException
Description copied from class: JsonGenerator
Writes a JSON double value.

Specified by:
writeNumber in class JsonGenerator
Throws:
IOException

writeNumber

public void writeNumber(BigDecimal v)
                 throws IOException
Description copied from class: JsonGenerator
Writes a JSON big decimal value.

Specified by:
writeNumber in class JsonGenerator
Throws:
IOException

writeNumber

public void writeNumber(String encodedValue)
                 throws IOException
Description copied from class: JsonGenerator
Writes a JSON numeric value that has already been encoded properly.

Specified by:
writeNumber in class JsonGenerator
Throws:
IOException


Copyright © 2011-2012 Google. All Rights Reserved.