A universal types-preserving Java serialization library that can convert arbitrary Java Objects into JSON and back

Overview

YaGson

WARNING

YaGson is best compatible with Java version from 6 to 8. It is not recommended for Java 9+.

Since Java 9 you may notice "Illegal reflective access" warning in the console output.

Since Java 12 there may be java.lang.reflect.InaccessibleObjectException thrown when attempting to serialize/deserialize some core classes. Since Java 16 such exception is thrown much more often.

Overview

YaGson is a universal type-preserving Java serialization library that can convert (almost) arbitrary Java Objects into JSON and back, with transparent support for circular references of any kind and with a full Java 9 compatibility.

YaGson is based on Google’s Gson, so it inherits all Gson benefits and adds new valuable features. The name YaGson is actually an abbreviation for "yet another Gson".

Compared to other JSON serializers, such as Gson or Jackson, YaGson imposes almost no restrictions on the serialized classes, and requires neither changes to those classes (like adding annotations for Jackson) nor custom Gson adapters for out-of-the-box support of complicated cases like:

  • child to parent references, self-references, and circular references of any other kind

  • mixed-type arrays, collections, and objects

  • inner, local, and anonymous classes.

Thanks to the above versatility, YaGson is a solid choice for implementing REST interfaces between Java server and client machines, e.g. for Java-based microservices.

Sample usage

The basic usage of YaGson is quite simple and is very similar to that of Gson. You just use classes YaGson or YaGsonBuilder instead of Gson/GsonBuilder.

First, create a mapper instance, using either default (1) or custom (2) settings:

  YaGson mapper = new YaGson(); // // (1)
  YaGson altMapper = new YaGsonBuilder()
     .setPrettyPrinting()
     // ... set other  custom Settings
     .create(); // // (2)

Now you can use the mapper instance to serialize Java primitives, objects, and arrays to JSON, and de-serialize them back:

  // ...
  Person obj = new Person("John", "Doe");

  String objJson = mapper.toJson(obj, Person.class); // // (3)
  // objJson = {"name":"John","family":"Doe"}

  Person deserisalizedObj = mapper.fromJson(objJson, Person.class); // // (4)
  // deserisalizedObj = Person{name='John', family='Doe'}

(3) Serialize to JSON with the toJson() method, providing the known de-serialization type Person.class

(4) De-serialize a JSON string back to a Java object with the fromJson() method, using the same de-serialization type as the one used in (3)

Warning
The serialization type used in toJson, MUST BE equal to or less specific than the de-serialization type used in fromJson. If the de-serialization type is not known at the time of serialization, just use Object.class.


For example:

  // ...
  String objJson = mapper.toJson(obj, Object.class);
  // objJson = {"@type":"samples.Person","@val":{"name":"John","family":"Doe"}} // // (5)

  Person deserisalizedObj = mapper.fromJson(objJson, Person.class);
  // deserisalizedObj = Person{name='John', family='Doe'}

  // or, with the same result:
  Person deserisalizedObj2 = (Person) mapper.fromJson(objJson, Object.class);

(5) Notice the @type/@val wrapper around the first JSON representation of the Person instance. YaGson adds such wrappers when the actual type at run time is more specific than the provided serialization type.

Tip

When working with generic types, it is recommended to provide fully parameterized serialization/deserialization types using Gson’s TypeTokens, like

    Type myMapType = new TypeToken<HashMap<Long, String>>(){}.getType();
    String myMapJson = mapper.toJson(myMap, myMapType);


Finally, let’s see how a simple self-referencing array is serialized.

  Object[] obj = new Object[3];
  obj[0] = "foo";
  obj[1] = obj;
  obj[2] = "bar";

  String objJson = mapper.toJson(obj, Object[].class);
  // objJson = ["foo","@root","bar"]

  Object[] deserisalizedObj = mapper.fromJson(objJson, Object[].class);
  // deserisalizedObj = [foo, [...], bar]


Note
The JSON representation of the second element of the array is @root, meaning a reference to the serialized object itself. There may be more complicated references, describing a path from the root to a referenced object, e.g. @root.0.field1.1-key. Also, there are shortcut references like @.field, which point to a sibling field in the parent object.

New in version 0.5.1

  • Support serialization of non-iterable collections and maps

New in version 0.5

  • Support for JsonSerializer/JsonDeserializer

  • New ReferencePolicy: DETECT_CIRCULAR_AND_THROW

  • Improvements and bugfixes

  • google-gson codebase is updated to release 2.8.5

New in version 0.4.1

  • Support for Android 4 (limited)

New in version 0.4

  • Java 9 compatibility (works for Java 11 too)

  • google-gson codebase is updated to release 2.8.2

New in version 0.3.1

  • Bugfixes

New in version 0.3

New features:

  • Ability to specify class loaders to use for de-serialization, see YaGsonBuilder.setPreferredClassLoaders();

  • Ability to limit the output JSON length, see YaGson.toJson(Object src, long charsLimit)

Updates:

  • google-gson codebase is updated to release 2.8.1

  • bugfixes

New in version 0.2

New features:

  • Java 8 support, including:

    • full serialization and de-serialization of serializable lambdas;

    • skipping non-serializable lambdas;

Updates:

  • google-gson codebase is updated to release 2.8.0

New in version 0.1

New features:

  • mapping of (almost) arbitrary objects, with no need for custom adapters, annotations, or any other changes of the serialized classes;

  • preservation of exact types during mapping;

  • preservation of Collections/Maps behavior, including custom Comparators;

  • serialization of self-referencing objects, including collections, maps, and arrays;

  • serialization of inner, local, and anonymous classes;

  • support for mixed-type collections, maps, and arrays;

  • support for multiple fields with the same name in one object (e.g. when "duplicate" fields are declared in super-classes);

License

Licensed under the Apache License, Version 2.0

More

For more information and samples, see the User’s Guide and Q&A. Also, some samples runnable as JUnit tests are available in the yagson-samples GitHub project.

Contact Us

To report a bug or suggest improvements, please open a GitHub issue.

To get in touch with the YaGson author, please write to [email protected]

Comments
  • Java 16 support

    Java 16 support

    I haven't looked into it much, but I think there might be a problem with Java 16 support. This problem could start as early as Java 12 - I only checked 11 and 16.

    Using this to initialize: new YaGsonBuilder().excludeFieldsWithModifiers(Modifier.TRANSIENT, Modifier.STATIC, Modifier.VOLATILE);

    Exception in thread "JavaFX Application Thread" java.lang.ExceptionInInitializerError
    	at com.gilecode.yagson.com.google.gson.internal.Excluder.<clinit>(Excluder.java:71)
    	at com.gilecode.yagson.com.google.gson.GsonBuilder.<init>(GsonBuilder.java:79)
    	at com.gilecode.yagson.YaGsonBuilder.<init>(YaGsonBuilder.java:36)
    
    Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field final transient java.lang.Class java.util.EnumSet.elementType accessible: module java.base does not "opens java.util" to unnamed module @19e0a4f6
    	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
    	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
    	at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:177)
    	at java.base/java.lang.reflect.Field.setAccessible(Field.java:171)
    	at com.gilecode.yagson.com.google.gson.internal.reflect.UnsafeReflectionAccessor.makeAccessible(UnsafeReflectionAccessor.java:44)
    	at com.gilecode.yagson.types.TypeUtils.getDeclaredFieldNoChecks(TypeUtils.java:400)
    	at com.gilecode.yagson.types.TypeUtils.getDeclaredField(TypeUtils.java:418)
    	at com.gilecode.yagson.types.TypeUtils.<clinit>(TypeUtils.java:456)
    
    
    opened by louhy 6
  • java.lang.IllegalStateException: Field 'elementType' is not found in class java.util.EnumSet

    java.lang.IllegalStateException: Field 'elementType' is not found in class java.util.EnumSet

    Hello. I'm using your library in my android project. Actually, I've a smartphone and a tablet. In my smartphone (v8.0), all works fine (version 8.0), but in my tablet (v4.4) an exception is thrown.

    09-06 23:54:43.264 9766-9766/com.experiment.myapp E/AndroidRuntime: FATAL EXCEPTION: main
        Process: com.experiment.myapp, PID: 9766
        java.lang.ExceptionInInitializerError
            at com.gilecode.yagson.com.google.gson.internal.Excluder.<clinit>(Excluder.java:71)
            at com.gilecode.yagson.YaGson.<init>(YaGson.java:91)
            at com.experiment.myapp.global.PersonsMobilizations.PersonsMobilizationsPresenter.checkDetailRuleForPersonAtPosition(PersonsMobilizationsPresenter.java:45)
            at com.experiment.myapp.global.PersonsMobilizations.PersonMobilizationViewHolder.onClick(PersonMobilizationViewHolder.java:59)
            at android.view.View.performClick(View.java:4463)
            at android.view.View$PerformClick.run(View.java:18770)
            at android.os.Handler.handleCallback(Handler.java:808)
            at android.os.Handler.dispatchMessage(Handler.java:103)
            at android.os.Looper.loop(Looper.java:193)
            at android.app.ActivityThread.main(ActivityThread.java:5292)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
            at dalvik.system.NativeStart.main(Native Method)
         Caused by: java.lang.IllegalStateException: Field 'elementType' is not found in class java.util.EnumSet
            at com.gilecode.yagson.types.TypeUtils.getDeclaredField(TypeUtils.java:405)
            at com.gilecode.yagson.types.TypeUtils.<clinit>(TypeUtils.java:435)
            at com.gilecode.yagson.com.google.gson.internal.Excluder.<clinit>(Excluder.java:71) 
            at com.gilecode.yagson.YaGson.<init>(YaGson.java:91) 
            at com.experiment.myapp.global.PersonsMobilizations.PersonsMobilizationsPresenter.checkDetailRuleForPersonAtPosition(PersonsMobilizationsPresenter.java:45) 
            at com.experiment.myapp.global.PersonsMobilizations.PersonMobilizationViewHolder.onClick(PersonMobilizationViewHolder.java:59) 
            at android.view.View.performClick(View.java:4463) 
            at android.view.View$PerformClick.run(View.java:18770) 
            at android.os.Handler.handleCallback(Handler.java:808) 
            at android.os.Handler.dispatchMessage(Handler.java:103) 
            at android.os.Looper.loop(Looper.java:193) 
            at android.app.ActivityThread.main(ActivityThread.java:5292) 
            at java.lang.reflect.Method.invokeNative(Native Method) 
            at java.lang.reflect.Method.invoke(Method.java:515) 
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824) 
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640) 
            at dalvik.system.NativeStart.main(Native Method) 
         Caused by: java.lang.NoSuchFieldException: elementType
            at java.lang.Class.getDeclaredField(Class.java:596)
            at com.gilecode.yagson.types.TypeUtils.getDeclaredField(TypeUtils.java:401)
            at com.gilecode.yagson.types.TypeUtils.<clinit>(TypeUtils.java:435) 
            at com.gilecode.yagson.com.google.gson.internal.Excluder.<clinit>(Excluder.java:71) 
            at com.gilecode.yagson.YaGson.<init>(YaGson.java:91) 
            at com.experiment.myapp.global.PersonsMobilizations.PersonsMobilizationsPresenter.checkDetailRuleForPersonAtPosition(PersonsMobilizationsPresenter.java:45) 
            at com.experiment.myapp.global.PersonsMobilizations.PersonMobilizationViewHolder.onClick(PersonMobilizationViewHolder.java:59) 
            at android.view.View.performClick(View.java:4463) 
            at android.view.View$PerformClick.run(View.java:18770) 
            at android.os.Handler.handleCallback(Handler.java:808) 
            at android.os.Handler.dispatchMessage(Handler.java:103) 
            at android.os.Looper.loop(Looper.java:193) 
            at android.app.ActivityThread.main(ActivityThread.java:5292) 
            at java.lang.reflect.Method.invokeNative(Native Method) 
            at java.lang.reflect.Method.invoke(Method.java:515) 
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824) 
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640) 
            at dalvik.system.NativeStart.main(Native Method)
    

    Exception is thrown during the initialization of YaGson

    YaGson gson = new YaGson();

    opened by davide1995 4
  • Bump junit from 3.8.2 to 4.13.1 in /metrics

    Bump junit from 3.8.2 to 4.13.1 in /metrics

    Bumps junit from 3.8.2 to 4.13.1.

    Release notes

    Sourced from junit's releases.

    JUnit 4.13.1

    Please refer to the release notes for details.

    JUnit 4.13

    Please refer to the release notes for details.

    JUnit 4.13 RC 2

    Please refer to the release notes for details.

    JUnit 4.13 RC 1

    Please refer to the release notes for details.

    JUnit 4.13 Beta 3

    Please refer to the release notes for details.

    JUnit 4.13 Beta 2

    Please refer to the release notes for details.

    JUnit 4.13 Beta 1

    Please refer to the release notes for details.

    JUnit 4.12

    Please refer to the release notes for details.

    JUnit 4.12 Beta 3

    Please refer to the release notes for details.

    JUnit 4.12 Beta 2

    No release notes provided.

    JUnit 4.12 Beta 1

    No release notes provided.

    JUnit 4.11

    No release notes provided.

    Changelog

    Sourced from junit's changelog.

    Summary of changes in version 4.13.1

    Rules

    Security fix: TemporaryFolder now limits access to temporary folders on Java 1.7 or later

    A local information disclosure vulnerability in TemporaryFolder has been fixed. See the published security advisory for details.

    Test Runners

    [Pull request #1669:](junit-team/junit#1669) Make FrameworkField constructor public

    Prior to this change, custom runners could make FrameworkMethod instances, but not FrameworkField instances. This small change allows for both now, because FrameworkField's constructor has been promoted from package-private to public.

    Commits
    • 1b683f4 [maven-release-plugin] prepare release r4.13.1
    • ce6ce3a Draft 4.13.1 release notes
    • c29dd82 Change version to 4.13.1-SNAPSHOT
    • 1d17486 Add a link to assertThrows in exception testing
    • 543905d Use separate line for annotation in Javadoc
    • 510e906 Add sub headlines to class Javadoc
    • 610155b Merge pull request from GHSA-269g-pwp5-87pp
    • b6cfd1e Explicitly wrap float parameter for consistency (#1671)
    • a5d205c Fix GitHub link in FAQ (#1672)
    • 3a5c6b4 Deprecated since jdk9 replacing constructor instance of Double and Float (#1660)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump junit from 4.12 to 4.13.1

    Bump junit from 4.12 to 4.13.1

    Bumps junit from 4.12 to 4.13.1.

    Release notes

    Sourced from junit's releases.

    JUnit 4.13.1

    Please refer to the release notes for details.

    JUnit 4.13

    Please refer to the release notes for details.

    JUnit 4.13 RC 2

    Please refer to the release notes for details.

    JUnit 4.13 RC 1

    Please refer to the release notes for details.

    JUnit 4.13 Beta 3

    Please refer to the release notes for details.

    JUnit 4.13 Beta 2

    Please refer to the release notes for details.

    JUnit 4.13 Beta 1

    Please refer to the release notes for details.

    Commits
    • 1b683f4 [maven-release-plugin] prepare release r4.13.1
    • ce6ce3a Draft 4.13.1 release notes
    • c29dd82 Change version to 4.13.1-SNAPSHOT
    • 1d17486 Add a link to assertThrows in exception testing
    • 543905d Use separate line for annotation in Javadoc
    • 510e906 Add sub headlines to class Javadoc
    • 610155b Merge pull request from GHSA-269g-pwp5-87pp
    • b6cfd1e Explicitly wrap float parameter for consistency (#1671)
    • a5d205c Fix GitHub link in FAQ (#1672)
    • 3a5c6b4 Deprecated since jdk9 replacing constructor instance of Double and Float (#1660)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump gson from 2.5 to 2.8.9 in /metrics

    Bump gson from 2.5 to 2.8.9 in /metrics

    Bumps gson from 2.5 to 2.8.9.

    Release notes

    Sourced from gson's releases.

    Gson 2.8.9

    • Make OSGi bundle's dependency on sun.misc optional (#1993).
    • Deprecate Gson.excluder() exposing internal Excluder class (#1986).
    • Prevent Java deserialization of internal classes (#1991).
    • Improve number strategy implementation (#1987).
    • Fix LongSerializationPolicy null handling being inconsistent with Gson (#1990).
    • Support arbitrary Number implementation for Object and Number deserialization (#1290).
    • Bump proguard-maven-plugin from 2.4.0 to 2.5.1 (#1980).
    • Don't exclude static local classes (#1969).
    • Fix RuntimeTypeAdapterFactory depending on internal Streams class (#1959).
    • Improve Maven build (#1964).
    • Make dependency on java.sql optional (#1707).

    Gson 2.8.8

    • Fixed issue with recursive types (#1390).
    • Better behaviour with Java 9+ and Unsafe if there is a security manager (#1712).
    • EnumTypeAdapter now works better when ProGuard has obfuscated enum fields (#1495).
    Changelog

    Sourced from gson's changelog.

    Version 2.8.9

    • Make OSGi bundle's dependency on sun.misc optional (#1993).
    • Deprecate Gson.excluder() exposing internal Excluder class (#1986).
    • Prevent Java deserialization of internal classes (#1991).
    • Improve number strategy implementation (#1987).
    • Fix LongSerializationPolicy null handling being inconsistent with Gson (#1990).
    • Support arbitrary Number implementation for Object and Number deserialization (#1290).
    • Bump proguard-maven-plugin from 2.4.0 to 2.5.1 (#1980).
    • Don't exclude static local classes (#1969).
    • Fix RuntimeTypeAdapterFactory depending on internal Streams class (#1959).
    • Improve Maven build (#1964).
    • Make dependency on java.sql optional (#1707).

    Version 2.8.8

    • Fixed issue with recursive types (#1390).
    • Better behaviour with Java 9+ and Unsafe if there is a security manager (#1712).
    • EnumTypeAdapter now works better when ProGuard has obfuscated enum fields (#1495).

    Version 2.8.7

    • Fixed ISO8601UtilsTest failing on systems with UTC+X.
    • Improved javadoc for JsonStreamParser.
    • Updated proguard.cfg (#1693).
    • Fixed IllegalStateException in JsonTreeWriter (#1592).
    • Added JsonArray.isEmpty() (#1640).
    • Added new test cases (#1638).
    • Fixed OSGi metadata generation to work on JavaSE < 9 (#1603).

    Version 2.8.6

    2019-10-04 GitHub Diff

    • Added static methods JsonParser.parseString and JsonParser.parseReader and deprecated instance method JsonParser.parse
    • Java 9 module-info support

    Version 2.8.5

    2018-05-21 GitHub Diff

    • Print Gson version while throwing AssertionError and IllegalArgumentException
    • Moved utils.VersionUtils class to internal.JavaVersion. This is a potential backward incompatible change from 2.8.4
    • Fixed issue google/gson#1310 by supporting Debian Java 9

    Version 2.8.4

    2018-05-01 GitHub Diff

    • Added a new FieldNamingPolicy, LOWER_CASE_WITH_DOTS that mapps JSON name someFieldName to some.field.name
    • Fixed issue google/gson#1305 by removing compile/runtime dependency on sun.misc.Unsafe

    Version 2.8.3

    2018-04-27 GitHub Diff

    • Added a new API, GsonBuilder.newBuilder() that clones the current builder
    • Preserving DateFormatter behavior on JDK 9

    ... (truncated)

    Commits
    • 6a368d8 [maven-release-plugin] prepare release gson-parent-2.8.9
    • ba96d53 Fix missing bounds checks for JsonTreeReader.getPath() (#2001)
    • ca1df7f #1981: Optional OSGi bundle's dependency on sun.misc package (#1993)
    • c54caf3 Deprecate Gson.excluder() exposing internal Excluder class (#1986)
    • e6fae59 Prevent Java deserialization of internal classes (#1991)
    • bda2e3d Improve number strategy implementation (#1987)
    • cd748df Fix LongSerializationPolicy null handling being inconsistent with Gson (#1990)
    • fe30b85 Support arbitrary Number implementation for Object and Number deserialization...
    • 1cc1627 Fix incorrect feature request template label (#1982)
    • 7b9a283 Bump bnd-maven-plugin from 5.3.0 to 6.0.0 (#1985)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • client side circular refs

    client side circular refs

    What do you guys do about the circular refs client side? I'm working on a script to make the javascript objects look just like the java objects in memory. Also need to remove those circular refs before calling JSON.stringify

    opened by vinnyjames 1
Releases(v0.4.1)
Owner
Andrey Mogilev
Andrey Mogilev
Convert Java to JSON. Convert JSON to Java. Pretty print JSON. Java JSON serializer.

json-io Perfect Java serialization to and from JSON format (available on Maven Central). To include in your project: <dependency> <groupId>com.cedar

John DeRegnaucourt 303 Dec 30, 2022
A simple java JSON deserializer that can convert a JSON into a java object in an easy way

JSavON A simple java JSON deserializer that can convert a JSON into a java object in an easy way. This library also provide a strong object convertion

null 0 Mar 18, 2022
Generate Java types from JSON or JSON Schema and annotates those types for data-binding with Jackson, Gson, etc

jsonschema2pojo jsonschema2pojo generates Java types from JSON Schema (or example JSON) and can annotate those types for data-binding with Jackson 2.x

Joe Littlejohn 5.9k Jan 5, 2023
MapNeat is a JVM library written in Kotlin that provides an easy to use DSL (Domain Specific Language) for transforming JSON to JSON, XML to JSON, POJO to JSON in a declarative way.

MapNeat is a JVM library written in Kotlin that provides an easy to use DSL (Domain Specific Language) for transforming JSON to JSON, XML to JSON, POJ

Andrei Ciobanu 59 Sep 17, 2022
Screaming fast JSON parsing and serialization library for Android.

#LoganSquare The fastest JSON parsing and serializing library available for Android. Based on Jackson's streaming API, LoganSquare is able to consiste

BlueLine Labs 3.2k Dec 18, 2022
Framework for serialization to Json, XML, Byte and Excel, therefore an oviparous wool milk sow J

NetworkParser Framework for serialization from Java objects to Json, XML and Byte. NetworkParser is a simple framework for serializing complex model s

Fujaba Tool Suite 4 Nov 18, 2020
JSON to JSON transformation library written in Java.

Jolt JSON to JSON transformation library written in Java where the "specification" for the transform is itself a JSON document. Useful For Transformin

Bazaarvoice 1.3k Dec 30, 2022
Essential-json - JSON without fuss

Essential JSON Essential JSON Rationale Description Usage Inclusion in your project Parsing JSON Rendering JSON Building JSON Converting to JSON Refer

Claude Brisson 1 Nov 9, 2021
A 250 lines single-source-file hackable JSON deserializer for the JVM. Reinventing the JSON wheel.

JSON Wheel Have you ever written scripts in Java 11+ and needed to operate on some JSON string? Have you ever needed to extract just that one deeply-n

Roman Böhm 14 Jan 4, 2023
A JSON Transmission Protocol and an ORM Library for automatically providing APIs and Docs.

?? 零代码、热更新、全自动 ORM 库,后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构。 ?? A JSON Transmission Protocol and an ORM Library for automatically providing APIs and Docs.

Tencent 14.4k Dec 31, 2022
Text Object Java Objects (TOJOs): an object representation of a multi-line structured text file like CSV

It's a simple manager of "records" in a text file of CSV, JSON, etc. format. It's something you would use when you don't want to run a full database,

Yegor Bugayenko 19 Dec 27, 2022
A modern JSON library for Kotlin and Java.

Moshi Moshi is a modern JSON library for Android and Java. It makes it easy to parse JSON into Java objects: String json = ...; Moshi moshi = new Mos

Square 8.7k Dec 31, 2022
Sawmill is a JSON transformation Java library

Update: June 25, 2020 The 2.0 release of Sawmill introduces a breaking change to the GeoIpProcessor to comply with the updated license of the MaxMind

Logz.io 100 Jan 1, 2023
Genson a fast & modular Java <> Json library

Genson Genson is a complete json <-> java conversion library, providing full databinding, streaming and much more. Gensons main strengths? Easy to use

null 212 Jan 3, 2023
Lean JSON Library for Java, with a compact, elegant API.

mJson is an extremely lightweight Java JSON library with a very concise API. The source code is a single Java file. The license is Apache 2.0. Because

Borislav Iordanov 77 Dec 25, 2022
Elide is a Java library that lets you stand up a GraphQL/JSON-API web service with minimal effort.

Elide Opinionated APIs for web & mobile applications. Read this in other languages: 中文. Table of Contents Background Documentation Install Usage Secur

Yahoo 921 Jan 3, 2023
JSON Library for Java with a focus on providing a clean DSL

JSON Library for Java with a focus on providing a clean DSL

Vaishnav Anil 0 Jul 11, 2022
High performance JVM JSON library

DSL-JSON library Fastest JVM (Java/Android/Scala/Kotlin) JSON library with advanced compile-time databinding support. Compatible with DSL Platform. Ja

New Generation Software Ltd 835 Jan 2, 2023
A JSON Schema validation implementation in pure Java, which aims for correctness and performance, in that order

Read me first The current version of this project is licensed under both LGPLv3 (or later) and ASL 2.0. The old version (2.0.x) was licensed under LGP

Java Json Tools 1.5k Jan 4, 2023