public interface KeenJsonHandler
Reader into an
in-memory object (in the form of a Map<String, Object>), and for writing that
object back out to a Writer.
This interface allows the Keen library to be configured to use different JSON implementations in different environments, depending upon requirements for speed versus size (or other considerations).
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
readJson(java.io.Reader reader)
Reads JSON-formatted data from the provided
Reader and constructs a
Map representing the object described. |
void |
writeJson(java.io.Writer writer,
java.util.Map<java.lang.String,?> value)
Writes the given object (in the form of a
Map<String, Object> to the specified
Writer. |
java.util.Map<java.lang.String,java.lang.Object> readJson(java.io.Reader reader)
throws java.io.IOException
Reader and constructs a
Map representing the object described. The keys of the map should
correspond to the names of the top-level members, and the values may primitives (Strings,
Integers, Booleans, etc.), Maps, or Iterables.reader - The Reader from which to read the JSON data.Map<String, Object>.java.io.IOException - If there is an error reading from the input.void writeJson(java.io.Writer writer,
java.util.Map<java.lang.String,?> value)
throws java.io.IOException
Map<String, Object> to the specified
Writer.writer - The Writer to which the JSON data should be written.value - The object to write.java.io.IOException - If there is an error writing to the output.