org.zkoss.json
Class JSONObject
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<Object,Object>
org.zkoss.json.JSONObject
- All Implemented Interfaces:
- Serializable, Cloneable, Map<Object,Object>, JSONAware
public class JSONObject
- extends LinkedHashMap<Object,Object>
- implements Map<Object,Object>, JSONAware
A JSON object. Key value pairs are in the order of adding.
JSONObject supports java.util.Map interface.
- Author:
- FangYidong
- See Also:
- Serialized Form
| Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
| Methods inherited from interface java.util.Map |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
JSONObject
public JSONObject()
toJSONString
public static String toJSONString(Map map)
- Convert (aka., encode) a map to JSON text. The result is a JSON object.
If this map is also a JSONAware, JSONAware specific behaviours will be omitted at this top level.
- Parameters:
map -
- Returns:
- JSON text, or "null" if map is null.
- See Also:
JSONValue.toJSONString(Object)
toJSONString
public String toJSONString()
- Encodes this object to a JSON string.
It is the same as
toString().
- Specified by:
toJSONString in interface JSONAware
- Returns:
- JSON text
toString
public String toString()
- Encodes this object to a JSON string.
It is the same as
toJSONString().
- Overrides:
toString in class AbstractMap<Object,Object>
toString
public static String toString(String key,
Object value)
Copyright © 2013. All Rights Reserved.