https://github.com/lupcode/java-json
Robust and efficient JSON parser and generator that includes line and column tracker for error handling. Can handle strings as well as streams for parsing and generating.
https://github.com/lupcode/java-json
api column-tracker efficient efficient-json-parser java java-8 java-json json json-api json-parser library parsing robust streams utf8 utf8-characters utf8-string
Last synced: 4 months ago
JSON representation
Robust and efficient JSON parser and generator that includes line and column tracker for error handling. Can handle strings as well as streams for parsing and generating.
- Host: GitHub
- URL: https://github.com/lupcode/java-json
- Owner: LupCode
- License: mit
- Created: 2020-12-23T14:56:50.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-31T12:11:10.000Z (over 4 years ago)
- Last Synced: 2025-01-14T21:48:04.883Z (6 months ago)
- Topics: api, column-tracker, efficient, efficient-json-parser, java, java-8, java-json, json, json-api, json-parser, library, parsing, robust, streams, utf8, utf8-characters, utf8-string
- Language: Java
- Homepage: https://lupcode.com
- Size: 76.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Java JSON API
Robust and efficient JSON parser and generator that includes line and column tracker for error handling.
Can handle strings as well as streams for parsing and generating.## Requires:
- [LupCode Utilities Library](https://github.com/luca-vogels/java-utilities)## How to use:
``` java
String jsonStr = "{\"Hello World\":[{\"Test\":1.2,\"Bye\":null},345,]}";
// Automatically detects class needed to parse JSON
JSON> autoJson = JSON.parseAutoJSON(jsonStr);
System.out.println(autoJson.toString(true));// Another example that shows how errors in the JSON data can be handled
try {
JsonObject jsonObj = JsonObject.parse(jsonStr);
System.out.println(jsonObj.toString());
} catch(JsonParseException ex) {
LineColumnTracker lct = ex.getLineColumn();
if(lct != null)
System.out.println("Error occurred at line "+lct.getLine()+", column "+lct.getColumn());
else
ex.printStackTrace();
}
```## References:
- [LupCode.com](https://lupcode.com)
- [Lup.services](https://lup.services)