Class MockJsonFactory
java.lang.Object
com.google.api.client.json.JsonFactory
com.google.api.client.testing.json.MockJsonFactory
- Since:
- 1.15 (since 1.11 as com.google.api.client.testing.http.json.MockJsonFactory)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateJsonGenerator
(OutputStream out, Charset enc) Returns a new instance of a low-level JSON serializer for the given output stream and encoding.createJsonGenerator
(Writer writer) Returns a new instance of a low-level JSON serializer for the given writer.Returns a new instance of a low-level JSON parser for the given input stream.createJsonParser
(InputStream in, Charset charset) Returns a new instance of a low-level JSON parser for the given input stream.createJsonParser
(Reader reader) Returns a new instance of a low-level JSON parser for the given reader.createJsonParser
(String value) Returns a new instance of a low-level JSON parser for the given string value.Methods inherited from class com.google.api.client.json.JsonFactory
createJsonObjectParser, fromInputStream, fromInputStream, fromReader, fromString, toByteArray, toPrettyString, toString
-
Constructor Details
-
MockJsonFactory
public MockJsonFactory()
-
-
Method Details
-
createJsonParser
Description copied from class:JsonFactory
Returns a new instance of a low-level JSON parser for the given input stream. The parser tries to detect the charset of the input stream by itself.- Specified by:
createJsonParser
in classJsonFactory
- Parameters:
in
- input stream- Returns:
- new instance of a low-level JSON parser
- Throws:
IOException
-
createJsonParser
Description copied from class:JsonFactory
Returns a new instance of a low-level JSON parser for the given input stream.- Specified by:
createJsonParser
in classJsonFactory
- Parameters:
in
- input streamcharset
- charset in which the input stream is encoded ornull
to let the parser detect the charset- Returns:
- new instance of a low-level JSON parser
- Throws:
IOException
-
createJsonParser
Description copied from class:JsonFactory
Returns a new instance of a low-level JSON parser for the given string value.- Specified by:
createJsonParser
in classJsonFactory
- Parameters:
value
- string value- Returns:
- new instance of a low-level JSON parser
- Throws:
IOException
-
createJsonParser
Description copied from class:JsonFactory
Returns a new instance of a low-level JSON parser for the given reader.- Specified by:
createJsonParser
in classJsonFactory
- Parameters:
reader
- reader- Returns:
- new instance of a low-level JSON parser
- Throws:
IOException
-
createJsonGenerator
Description copied from class:JsonFactory
Returns a new instance of a low-level JSON serializer for the given output stream and encoding.- Specified by:
createJsonGenerator
in classJsonFactory
- Parameters:
out
- output streamenc
- encoding- Returns:
- new instance of a low-level JSON serializer
- Throws:
IOException
-
createJsonGenerator
Description copied from class:JsonFactory
Returns a new instance of a low-level JSON serializer for the given writer.- Specified by:
createJsonGenerator
in classJsonFactory
- Parameters:
writer
- writer- Returns:
- new instance of a low-level JSON serializer
- Throws:
IOException
-