public class AndroidJsonHandler extends 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 |
|---|---|
Map<String,Object> |
readJson(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(Writer writer,
Map<String,?> value) |
public Map<String,Object> readJson(Reader reader) throws IOException
readJson in interface io.keen.client.java.KeenJsonHandlerIOExceptionpublic void writeJson(Writer writer, Map<String,?> value) throws IOException
writeJson in interface io.keen.client.java.KeenJsonHandlerIOExceptionpublic 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.