easyJSON
An easy to use and light-weight library for creating JSON in java.
UPDATES
Version: 1.1 | Updated On: 14 February 2014 | Description: Support for Java Objects
INFORMATION
Author: Yuvraj Singh Babrah | Version: 1.0 | Release Date: 28 November 2013
INSTRUCTIONS
- Include the easyJSON package in the same path as that of your class files of a JAVA program.
- Type "import easyJSON.*" (Basic Step)
- A new json object will be created by instantiating the easyJSON class as follows: easyJSON json = new easyJSON();
- To add key-value pairs simply use the add(String key, Object value) method as follows: json.add("Name", "Yuvraj Singh Babrah"); json.add("Age", 21); The key-value pairs are in accordance to the json rules laid out on http://json.org
- To retrieve a value, use the get(String key) method as follows: json.get("Name"); The key should be in quotes. The return value, if of type String, will be without the quotes.
- To remove a key-value pair, use the remove method(String key).
- To instantiate the json array object use the easyJSONArray Constructor easyJSONArray array = new easyJSONArray();
- To add elements, use the add(Object value) method.
- To retreive the value, use the get(int key) method.
- To remove an element, use the remove(_) method which takes either index or Object as a paramenter.
CONTACT
If you find any bug or feel that some feature is missing shoot me a mail on yuvrajb@users.noreply.github.com or direct message me on facebook: https://facebook.com/yuvraj.babrah | twitter: https://twitter.com/yuvrajb | visit: http://yuvrajbabrah.eu5.org