public final class JsonSerializer extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
append(Appendable buf,
Object value)
Appends a value to the buffer.
|
static void |
appendArray(Appendable buf,
Object[] array)
Appends an array to the buffer.
|
static void |
appendCollection(Appendable buf,
Collection<?> collection)
Appends a Collection to the buffer.
|
static void |
appendJsonArray(Appendable buf,
org.json.JSONArray array)
Append a JSONArray to the buffer.
|
static void |
appendJsonObject(Appendable buf,
org.json.JSONObject object)
Appends a JSONObject to the buffer.
|
static void |
appendMap(Appendable buf,
Map<String,?> map)
Appends a Map to the buffer.
|
static void |
appendMultimap(Appendable buf,
com.google.common.collect.Multimap<String,Object> map)
Appends a Map to the buffer.
|
static void |
appendPojo(Appendable buf,
Object pojo)
Appends a java object using getters
|
static void |
appendString(Appendable buf,
CharSequence string)
Appends a string to the buffer.
|
static String |
serialize(Collection<?> collection)
Serializes a Collection as a JSON array.
|
static String |
serialize(org.json.JSONArray array)
Serializes a JSON array.
|
static String |
serialize(org.json.JSONObject object)
Serialize a JSONObject.
|
static String |
serialize(Map<String,?> map)
Serializes a Map as a JSON object.
|
static String |
serialize(Object object) |
static String |
serialize(Object[] array)
Serializes an array as a JSON array.
|
public static String serialize(org.json.JSONObject object)
public static String serialize(Map<String,?> map)
public static String serialize(Collection<?> collection)
public static String serialize(Object[] array)
public static String serialize(org.json.JSONArray array)
public static void append(Appendable buf, Object value) throws IOException
IOException - If Appendable.append(char) throws an exception.public static void appendPojo(Appendable buf, Object pojo) throws IOException
IOException - If Appendable.append(char) throws an exception.public static void appendArray(Appendable buf, Object[] array) throws IOException
IOException - If Appendable.append(char) throws an exception.public static void appendJsonArray(Appendable buf, org.json.JSONArray array) throws IOException
IOException - If Appendable.append(char) throws an exception.public static void appendCollection(Appendable buf, Collection<?> collection) throws IOException
IOException - If Appendable.append(char) throws an exception.public static void appendMap(Appendable buf, Map<String,?> map) throws IOException
IOException - If Appendable.append(char) throws an exception.public static void appendMultimap(Appendable buf, com.google.common.collect.Multimap<String,Object> map) throws IOException
IOException - If Appendable.append(char) throws an exception.public static void appendJsonObject(Appendable buf, org.json.JSONObject object) throws IOException
IOException - If Appendable.append(char) throws an exception.public static void appendString(Appendable buf, CharSequence string) throws IOException
IOException - If Appendable.append(char) throws an exception.Copyright © 2007-2012. All Rights Reserved.