Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jackson Mr Bean Bean Materializer support for toString implementation #122

Open
softwarebrahma opened this issue Dec 11, 2020 · 1 comment
Labels

Comments

@softwarebrahma
Copy link

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

@cowtowncoder
Copy link
Member

That sounds like a good improvement idea. There are couple of open questions that'd have to be defined:

  1. 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 above java.lang.Object, I assume?)
  2. 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants