A small JSON parsing library
forax at univ-mlv.fr
Thu Feb 14 07:53:23 PST 2013
just to see how it goes, I've written a small all-in-one-file library
that parses a JSON files to an object tree defined by the user. The
mapping is specified using lambdas, so it's compact but can burn your
The idea is that the JSON parser is triggered by the consumption of the
so when the code do by example a forEach on a Stream, the parser parse
the corresponding objects.
I've used an already existing push parser named json-simple for that.
During the development, I've found two main gotchas,
the first one is the scope rules of the lambda parameter,
I've already sent message about this rule, it seems that eah time I
write a page of code, the compiler stop me because I tend to re-use the
same variable name for the very same object.
In the example named Big , the builder of JSON schema is used
recursively but I've to use a different names each time (builder,
We should really remove this stupid rule from the JLS and go back to the
classical shadowing rules.
The second problem is that the implementation uses method handles to but
due to the poor integration betweeen method handles and lambdas, I've 20
lines of boilerplate and error prone code  which is moreover executed
More information about the lambda-libs-spec-observers