Adapted json-smart version; fast/small JSON decoder and encoder
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
accessors-smart
json-smart
src
.gitignore
.travis.yml
LICENSE
NOTICE
README.md
commands.txt
pom.xml

README.md

License Build Status Maven Central

atbash-json-smart

Small library capable of converting Java instances to JSON and back, for Java 7 based on JSON Smart v2.

With the standardization of this functionality in JSON-B, it advised to use a JSON-B implementation when using Java 8.

Configuration

Add artifact to pom.xml file.


<dependency>
    <groupId>be.atbash.json</groupId>
    <artifactId>octopus-json-smart</artifactId>
    <version>0.9.1</version>
</dependency>

Reading JSON

Converts the "<json>" string to instance of T.


T JSONValue.parse("<json>", Class<T>);

Converting to JSON

Converts the POJO T to a JSON String


String JSONValue.toJSONString(T);

Customizing JSON reading/creation

  • Implement the JSONAware interface
  • Define custom encoders and writers with @MappedBy and custom CustomJSONEncoder, CustomBeanJSONEncoder and/or Writer.