Compile-Time generation of gson adapters
Go to file
2022-11-01 11:50:02 +01:00
gson-compile-annotations Support for nested types within same sources 2022-11-01 10:29:09 +01:00
gson-compile-core Readme, support for enforcing no reflection 2022-11-01 09:55:08 +01:00
gson-compile-example Update README 2022-11-01 11:50:02 +01:00
gson-compile-processor Unify code for finding applicable adapter 2022-11-01 11:44:39 +01:00
.gitignore Support for 1d classes of primitives 2022-10-31 20:52:48 +01:00
build.gradle.kts Support for 1d classes of primitives 2022-10-31 20:52:48 +01:00
LICENSE.md License 2022-11-01 10:15:29 +01:00
README.md Update README 2022-11-01 11:50:02 +01:00
settings.gradle.kts Support for 1d classes of primitives 2022-10-31 20:52:48 +01:00

Gson-Compile

A java annotation processor implementing automated type adapter generation for gson-comments. The goal of this AP is to

  • Support common features such as getters, setters, fields, constructors
  • Support modern language features such as records
  • Support json5 through gson-comments
  • Be compile-time where possible (ideally compatible with proguard)

Currently supported

  • Primitive types
  • Adapter generation
  • Utility methods
  • Strict no-reflection enforcement via -AgsonCompileNoReflect
  • Comments via @GComment
  • Records
  • Nested serializable types

TODO

  • Arrays
  • Collections (Sets, Lists, Queues, Deques)
  • Maps
  • Date
  • Enums
  • Support for nested types from libraries
  • Static classes (for configs)
  • GPrefer to bypass builder/constructor recovery

Credit

The Gson-Compile processor is based on gsonvalue and value-processor by Eva Tatarka. The API was inspired by kotlinx.serialization by Jetbrains The serialization is powered by my fork of gson by Google