|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.api.client.json.JsonFactory
com.google.api.client.testing.http.json.MockJsonFactory
public class MockJsonFactory
Mock for JsonFactory
.
Implementation is thread-safe.
Constructor Summary | |
---|---|
MockJsonFactory()
|
Method Summary | |
---|---|
JsonGenerator |
createJsonGenerator(OutputStream out,
Charset enc)
Returns a new instance of a low-level JSON serializer for the given output stream and encoding. |
JsonGenerator |
createJsonGenerator(Writer writer)
Returns a new instance of a low-level JSON serializer for the given writer. |
JsonParser |
createJsonParser(InputStream in)
Returns a new instance of a low-level JSON parser for the given input stream. |
JsonParser |
createJsonParser(InputStream in,
Charset charset)
Returns a new instance of a low-level JSON parser for the given input stream. |
JsonParser |
createJsonParser(Reader reader)
Returns a new instance of a low-level JSON parser for the given reader. |
JsonParser |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MockJsonFactory()
Method Detail |
---|
public JsonParser createJsonParser(InputStream in) throws IOException
JsonFactory
createJsonParser
in class JsonFactory
in
- input stream
IOException
- if failedpublic JsonParser createJsonParser(InputStream in, Charset charset) throws IOException
JsonFactory
Upgrade warning: Prior to version 1.11 this method would not accept null
for the
charset parameter. Since 1.11 null
is allowed and will force the underlying parser to
pick/detect the charset for the stream.
createJsonParser
in class JsonFactory
in
- input streamcharset
- charset in which the input stream is encoded or null
to let the parser
detect the charset
IOException
public JsonParser createJsonParser(String value) throws IOException
JsonFactory
createJsonParser
in class JsonFactory
value
- string value
IOException
- if failedpublic JsonParser createJsonParser(Reader reader) throws IOException
JsonFactory
createJsonParser
in class JsonFactory
reader
- reader
IOException
- if failedpublic JsonGenerator createJsonGenerator(OutputStream out, Charset enc) throws IOException
JsonFactory
createJsonGenerator
in class JsonFactory
out
- output streamenc
- encoding
IOException
- if failedpublic JsonGenerator createJsonGenerator(Writer writer) throws IOException
JsonFactory
createJsonGenerator
in class JsonFactory
writer
- writer
IOException
- if failed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |