https://github.com/daboross/json-serialization
Simple and effective JSON parsing and serialization.
https://github.com/daboross/json-serialization
Last synced: over 1 year ago
JSON representation
Simple and effective JSON parsing and serialization.
- Host: GitHub
- URL: https://github.com/daboross/json-serialization
- Owner: daboross
- License: other
- Created: 2015-03-01T22:47:27.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-06-08T05:08:08.000Z (about 10 years ago)
- Last Synced: 2025-01-30T14:27:05.024Z (over 1 year ago)
- Language: Java
- Size: 19.5 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
json-serialization
==================
This library provides simple and effective method of parsing JSON into Java Maps and Lists.
You can use the `JsonParser` class to parse a json string into either `List` or `Map`.
The `JsonSerialization` class can then serialize a `List` or `Map` into a json string.
Note that this library operates on 5 basic types:
- Numbers are represented by either `Integer`, `Double`, or `Long` by the `JsonParser` class,
though `JsonSerialization` will accept any class that implements `Number`.
- Strings are represented by the java `String` class.
- JSON objects are represented by the `Map` class in `JsonParser`,
though `JsonSerialization` will accept any `Map, ?>`, providing the map values are valid types
- JSON arrays are represented by the `List` class in `JsonParser`,
though `JsonSerialization` will accept any `Iterable>` class, providing the provided values are valid types.
- `null` is used to represent literal `null` values in JSON objects/arrays. The `JsonParser` class will produce Lists
and Maps which contain null values if the json string has an unquoted `null` value. The `JsonSerialization` class will
accept null values, and they will translate to literal unquoted `null` values in the produced string.
`JsonParser` and `JsonSerialization` will only produce/accept those 5 types of values.
No other type may be used with this library.
json-serialization is built to target Java 1.6 or greater.
json-serialization is based on the JSON-java project, though it has been thoroughly rebuilt into a simpler and lighter library.