Skip to content

iris2iris/iris-json-parser-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

iris-json-parser for Java

Faster up to 4 times parser comparing to standard org.json because of late objects initialization

Speed improvement is achieved by idea of Proxy pattern, where objects are created when requested.

Realisations for all languages

Examples of use

final var parser = new  IrisJsonParser(testString);
final var res = parser.parse(); // parsed to IrisJsonItem's

// stringifies objects
System.out.println("IrisJsonItem.toString/JSON string: " + res);

// stringifies objects to Appendable buffer
final var b = new StringBuilder();
res.joinTo(b);
System.out.println("IrisJsonItem.joinTo/JSON string:   " + b);

// Simple access to required object on objects tree
System.out.println("IrisJsonItem toString/JSON string: " + res.get("object").get("message").get("attachments").get(0).get("wall").get("id"));

// Access by string path
System.out.println("To Long: " + res.find("object message attachments 0 wall id").asLong());

// Access by string path
System.out.println("To Int: " + res.find("object message attachments 0 wall id").asInt());

// Stylized to Java/JavaScript properties access
System.out.println("To Double: " + res.find("object.message.attachments[0].wall.id").asDouble());

Check out CHANGELOG.md

⭐ If this tool was useful for you, don't forget to give star.

About

Faster up to 4 times JSON parser comparing to standard org.json because of late objects initialization

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages