Skip to content

A simple JSON Parser written in Java without any dependencies.

License

Notifications You must be signed in to change notification settings

SSEHUB/JsonParser

Repository files navigation

JsonParser

Build Status

A simple JSON Parser written in Java without any dependencies.

Usage

Download: Latest CI Build

The JSON data structure inherits from the abstract class net.ssehub.json.JsonElement. Implement net.ssehub.json.JsonVisitor for traversal using the visitor pattern.

Parsing:

try {
	net.ssehub.json.JsonParser parser = new net.ssehub.json.JsonParser(fileOrStream);
	net.ssehub.json.JsonElement result = parser.parse();
} catch (IOException | net.ssehub.json.ParsingException e) {
	/* ... */
}

Writing:

net.ssehub.json.JsonElement json = /* ... */;
String s1 = json.toString(); // short representation
String s2 = json.accept(new net.ssehub.json.JsonPrettyPrinter()); // pretty representation

License

This project is licensed under the Apache License 2.0.

About

A simple JSON Parser written in Java without any dependencies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages