public class OrderedJSONObject extends JSONObject
| Constructor and Description |
|---|
OrderedJSONObject()
Create a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
(non-Javadoc)
|
java.lang.Object |
clone()
Returns a shallow copy of this HashMap instance: the keys and values themselves are not cloned.
|
java.util.Iterator |
getOrder()
Method to obtain the order in which the items will be serialized.
|
static JSONObject |
parse(java.io.InputStream is)
Convert a stream of JSON text into object form.
|
static JSONObject |
parse(java.io.Reader reader)
Convert a stream (in reader form) of JSON text into object form.
|
static JSONObject |
parse(java.lang.String str)
Convert a String of JSON text into object form.
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Method to put a JSON'able object into the instance.
|
java.lang.Object |
remove(java.lang.Object key)
Method to remove an entry from the OrderedJSONObject instance.
|
isValidObject, isValidType, serialize, serialize, serialize, serialize, serialize, serialize, toStringpublic OrderedJSONObject()
public static JSONObject parse(java.io.Reader reader) throws java.io.IOException
reader - The reader from which the JSON data is read.IOEXception - Thrown if an underlying IO error from the reader occurs, or if malformed JSON is read,java.io.IOExceptionpublic static JSONObject parse(java.lang.String str) throws java.io.IOException
str - The JSON string to parse into a Java Object.IOEXception - Thrown if malformed JSON is read,java.io.IOExceptionpublic static JSONObject parse(java.io.InputStream is) throws java.io.IOException
is - The InputStream from which to read the JSON. It will assume the input stream is in UTF-8 and read it as such.IOEXception - Thrown if an underlying IO error from the stream occurs, or if malformed JSON is read,java.io.IOExceptionpublic java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapput in class JSONObjectHashMap.put(java.lang.Object, java.lang.Object)public java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Mapremove in class java.util.HashMapHashMap.remove(java.lang.Object)public void clear()
clear in interface java.util.Mapclear in class java.util.HashMapHashMap.clear()public java.lang.Object clone()
clone in class java.util.HashMappublic java.util.Iterator getOrder()