Tuesday, 1 October 2013

how to expose class names when serializing with Gson

how to expose class names when serializing with Gson

My scenario is very complicated but here's a summary:
I'm trying to understand source of a compiler -- and to understand what
each AST node represents, I'm generating JSON serializations of ASTs of
different programs and later inspect the visualized JSON output.
It works great except one problem is that in Gson generated JSON data
class names isn't mentioned, so it still doesn't help much. Is there a way
to add class names to Gson output without much effort? (without adding
some method to every AST node etc.)

No comments:

Post a Comment