public class Cartographer
extends java.lang.Object
Map
objects from JSON encoded streams and decodes Map
objects into JSON streams. Use Cartographer.Builder
to construct instances.Modifier and Type | Class and Description |
---|---|
static class |
Cartographer.Builder
Fluent API to construct instances of
Cartographer . |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
fromJson(java.io.Reader reader)
Deserializes the json read from the specified
Reader into a Map . |
java.util.Map<java.lang.String,java.lang.Object> |
fromJson(java.lang.String json)
Deserializes the specified json into a
Map . |
java.lang.String |
toJson(java.util.Map<?,?> map)
Serializes the map into it's json representation and returns it as a String.
|
void |
toJson(java.util.Map<?,?> map,
java.io.Writer writer)
Serializes the map into it's json representation into the provided
Writer . |
public java.util.Map<java.lang.String,java.lang.Object> fromJson(java.lang.String json) throws java.io.IOException
Map
. If you have the Json in a Reader
form instead of a String
, use fromJson(Reader)
instead.java.io.IOException
public java.util.Map<java.lang.String,java.lang.Object> fromJson(java.io.Reader reader) throws java.io.IOException
Reader
into a Map
. If you have
the Json in a String form instead of a Reader
, use fromJson(String)
instead.java.io.IOException
public java.lang.String toJson(java.util.Map<?,?> map)
Writer
instead of retrieving it as a String, use toJson(Map,
Writer)
instead.public void toJson(java.util.Map<?,?> map, java.io.Writer writer) throws java.io.IOException
Writer
. If you want
to retrieve the json as a string, use toJson(Map)
instead.java.io.IOException