public class AndroidJsonHandler
extends java.lang.Object
implements io.keen.client.java.KeenJsonHandler
KeenJsonHandler interface using the built-in
Android JSON library (JSONObject).| Modifier and Type | Class and Description |
|---|---|
protected static interface |
AndroidJsonHandler.JsonObjectManager
Interface wrapping usage of JSONObjects.
|
| Constructor and Description |
|---|
AndroidJsonHandler() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
readJson(java.io.Reader reader) |
protected void |
setJsonObjectManager(AndroidJsonHandler.JsonObjectManager jsonObjectManager)
Sets the
AndroidJsonHandler.JsonObjectManager instance to use. |
void |
setWrapNestedMapsAndCollections(boolean value)
Sets whether or not this handler should wrap nested maps and collections explicitly.
|
void |
writeJson(java.io.Writer writer,
java.util.Map<java.lang.String,?> value) |
public java.util.Map<java.lang.String,java.lang.Object> readJson(java.io.Reader reader)
throws java.io.IOException
readJson in interface io.keen.client.java.KeenJsonHandlerjava.io.IOExceptionpublic void writeJson(java.io.Writer writer,
java.util.Map<java.lang.String,?> value)
throws java.io.IOException
writeJson in interface io.keen.client.java.KeenJsonHandlerjava.io.IOExceptionpublic void setWrapNestedMapsAndCollections(boolean value)
value - true to enable wrapping, false to disable it.protected void setJsonObjectManager(AndroidJsonHandler.JsonObjectManager jsonObjectManager)
AndroidJsonHandler.JsonObjectManager instance to use. By default this class will simply use
the normal Android JSONObject methods, but this method may be used to provide a different
implementation, such as a stubbed/mocked implementation for unit testing.jsonObjectManager - The AndroidJsonHandler.JsonObjectManager instance to use.