playframework/playframework — pull request #3306 by lloydmeta (2014-08-17 11:45:51+00:00)
Title: Add Macro for generating Writes JSON serializer for all getters in a class

As mentioned in #3302 I found myself wanting to have a macro that would generate a JSON serialiser that would serialise not just the constructor arguments of a case class, but across all getters (vals, vars) of a class, and so took at stab at implementing it.

In this PR, I refactored `JsMacroImpl` to pull out the code inside the original `macroImp` method into separate private helper methods to make the logic more reuseable and added a macro implementation method that looks for the getter methods in a given class and invokes those helpers to generate a `Writes` serializer.