FasterXML / jackson-docs

Documentation for the Jackson JSON processor.
719 stars 111 forks source link

Possible useful name pattern for PTH documentation #10

Open chrylis opened 7 years ago

chrylis commented 7 years ago

This is not a solution for every use case, in large part because the Reflections scan can take some time, but it's a pattern that may be generally applicable enough to describe in the documentation:

mapper.registerSubtypes(reflections.getTypesAnnotatedWith(FoocorpJsonType.class).toArray(new Class[0]));



This will scan the classpath (limited for performance) for types annotated with the custom annotation and register them all with the mapper so they can be deserialized when seen.
cowtowncoder commented 7 years ago

Quick question: does "PTH" refer to ... Polymorphic Type Handling? Also, this seems to be Spring specific.