jackson-modules-base
jackson-modules-base copied to clipboard
Jackson Mr Bean Bean Materializer support for toString implementation
Hello Folks,
I am using Jackson Mr Bean module to construct impl classes for defined interfaces. It works great, but one problem is that it does not generate an (overridden) implementation of toString() in the impl class resulting in the inability to use it for logging.
I worked around it by using default methods, but it would be nice to have that support.
Thanks Muthu
That sounds like a good improvement idea. There are couple of open questions that'd have to be defined:
- Applicability: strict (only if
toString()explicitly overridden as "abstract" to indicate it should be generated) or looser (if abstract or if target is interface)? Or something more customizable (specifically should not override explicit implementation from something abovejava.lang.Object, I assume?) - Implementation: what would be usable implementation, how to configure? Use a templating of some kind? (generation code does not have very good understanding of POJO semantics so it cannot implement much of logic, and
toString()specifically is passed no context of any kind so it cannot serialize as json or call any Jackson functionality)