bdwalker93 / json-simple

Automatically exported from code.google.com/p/json-simple
Apache License 2.0
0 stars 0 forks source link

Keep original JSON ordering - LinkedHashMap instead of Hashmap #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
For a project I'm working on I needed the data read my json-simple to adhere to 
the order in which the original JSON string is formatted. 

This can be simply accomplished by extending JSONObject from a LinkedHashMap. 

Would it be an idea to make this simple change in the main version of the 
json-simple library?

Thanks,
Bert Spaan

Original issue reported on code.google.com by bert.sp...@gmail.com on 13 Jan 2011 at 1:19

GoogleCodeExporter commented 8 years ago
It is possible to use LinkedHashMap in current implementation. Please refer to 
encoding examples for more information:
http://code.google.com/p/json-simple/wiki/EncodingExamples#Example_1-3_-_Encode_
a_JSON_object_-_Using_Map

Original comment by fangyid...@gmail.com on 14 Jan 2011 at 6:59