Package dev.gmitch215.bytebox.json


package dev.gmitch215.bytebox.json
JSON, through generated codecs rather than reflection.

Annotate a type JSONType and the Gradle plugin writes its codec and registers it. JSON is then the whole API.

The reason it is not reflective: a reflective decoder needs field metadata for every type that could arrive through an Object-typed field, which is the whole-program closure dead-code elimination exists to prune. The binary's size would track how many types were serialisable rather than how many were used. Generating a codec per named type keeps that closure to what was asked for.

Since:
1.0.0
  • Class
    Description
    Converts one type to and from a JavaScript value.
    Converts between Java types and JSON, through codecs rather than reflection.
    Generates a JSON codec for this type.