ralleytn / simplejson Goto Github PK
View Code? Open in Web Editor NEWAn improved version of json-simple for Java 11+
Home Page: https://ralleytn.github.io/SimpleJSON/
License: Apache License 2.0
An improved version of json-simple for Java 11+
Home Page: https://ralleytn.github.io/SimpleJSON/
License: Apache License 2.0
Issues: Pretty print in JSONFormatter doesn't allow for printing large json objects to a file only the indexed amount of chars which in unicode form most common json type is around 500 million chars. Sounds like alot but, actually isn't for a decent size json file.
Pretty print doesn't look right when outputted compared to test against json and https://jsoneditoronline.org/
when writing to the file using the very own writing built in there is no boolean for pretty print either remove it or add a param boolean for pretty print.
Pretty print in JSONFormatter doesn't allow for printing large json objects to a file only the indexed amount of chars which in unicode form most common json type is around 500 million chars. Sounds like alot but, actually isn't for a decent size json file.
Yes you can still support string/reader but, there should be a method inside where it only accepts Writer and will properly write the whole json object/array to the file the first time
when writing to a file there is no boolean in the parameters for pretty print directly. There shouldn't have to be a specified file reader for printing the json to a file from text either so just add the boolean here
Dear Sir,
Since most of the JSON keys are string for readability and best practise. It would be efficient to use Strings as keys by default like other JSON libraries. I found that it not only increases Parsing performance (PUT) but also GET operations.
Please consider defaulting keys to String and using an efficient HashMap for small data could increase the performance.
Thanks
Sandeep
Can I find the library in a maven repository?
Or can we get an jar file containing all the files?
A very little typo in the Summary of the Wiki. We have :
On the page
In the right menu
Parsing and Formatting urls are not ordered.
Pretty print doesn't look right when outputted compared to test against gson https://github.com/google/gson and https://jsoneditoronline.org/
Also on windows you fail to provide the proper line mechanics making me use non native windows notepad to edit the file. \r\n is the proper format or get it dynamically from the system.
I dont expect an answer but i do think it should be changed.
Original issue found here and still persists in current library:
fangyidong/json-simple#16
Test code no exceptions occur when it should occur:
https://pastebin.com/nq0CfHjX
Test 2 this is an invalid json string due to a dupe key when parsing. It''s fine if you want to replace a key using JSONObject.pu() in memory but, when parsing it from a file/invalid sting if they key already exists in that file/string then it is no longer acceptable
JSONParser parser = new JSONParser();
System.out.println("Done:" + parser.parse("{\"key\":1 \"key\":2}"));
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.