public class JSONSerializer extends Object implements Serializable
Writer. Both entry points share one
writer, so they produce the same text (Mantis 4799: two hand-copied paths had drifted apart).
A value is written by its type, wherever it sits (map value, list element, array element):
a String or Character as a string; a Number as a number, except that a
number with no JSON form, such as NaN or an infinity, becomes null; a
Boolean as true or false; a Collection or a Java array as an array;
anything else, a map or a bean, as an object through BeanUtil.bean2Map(Object).
A null map value or element is left out, and with ignoreId every member named
id is left out.
| Constructor and Description |
|---|
JSONSerializer() |
JSONSerializer(boolean ignoreId) |
public JSONSerializer(boolean ignoreId)
public JSONSerializer()
public void serialize(Map map, Writer writer) throws IOException
IOExceptionpublic void serialize(List list, Writer writer) throws IOException
IOException