FasterXML/jackson-module-scala — pull request #22 by nbauernfeind (2012-03-06 04:46:43+00:00)
Title: Adding Set Support

'Set's already naturally serialize as 'Seq'. This adds in the support for deserializing 'Set's.

This code is extremely similar to the SeqDeserializer, and if you want I could probably convert it to a generic class where the implementation for Seq and Set would be minimal extensions.

Additionally, I was thinking about your comment:
// This hurts my eyes, but it's the key component of making the type matching work.
// Also, order matters, as derived classes must come before base classes.
// TODO: try and make this lookup less painful-looking

One solution that fixes the ordering issue would be to generate a dependency graph (edges built via the Class.isAssignableFrom(Class) method) and build a topological sort. And, I imagine it should be possible to write a generic register method that uses Manifests to infer which class a specific GenericCompanion would build.

I'd be willing to do any of these things if they interest you.