-
Notifications
You must be signed in to change notification settings - Fork 53
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
Globally disabling getters and setters #44
Comments
The only available way is to use a mixin annotation on Though, I should be able to add a global configuration in |
Thanks. I tried with just Object, but then I got too many errors and warnings, which otherwise don't happen (if I annotate some tens of classes, which I use and don't want to use their setters and getters). We have many really complex classes, which were initially not meant for JSON, so it's likely their fault. It's my responsibility to fix them. However, stack overflow happens, if an object has itself as a field, like the linked lists or trees do have. |
I meant stack overflow while GWT is rebinding at the startup, not at runtime. Caused by: java.lang.StackOverflowError: null |
I don't understand how you get a stackoverflow. Do you have an example ? You also changed the auto detection for field to detect more than public fields ? |
I wrote this:
|
However, regarding the stack overflow, it's strange. I made a copy of the problematic class, to find which field or method causes problems, but the copy worked. So it seems it has something to do with the type hierarchy, as many other classes extend this one. Will try to analyze and will inform you soon. The class and it's hierarchy is too complex to send it as an example. It has one String id field, and parent of the same type as the object, but many methods, which start with "get" or "is". Thanks for all the info. |
I found a reason for stack overflow. It happens with parameterized classes that use themselves as a parameter, like:
|
Thanks, I'll look into it! |
You can now configure the default behaviour via a global configuration. Watch this wiki page to find how to add your custom configuration. |
Hello!
I our project repository we have thousands of classes, and not all were written conforming to the getter/setter patterns. This was not even required or necessary.
However, gwt-jackson by default processes such non-getter methods that start with "get***". As many such methods are not meant to be used outside of their contexts, they generate an error when called by gwt-jackson.
I know about @JsonAutoDetect. But I don't want to write annotations (or use mixin annotations) for 1000 classes!
Is there a way, to globally configure gwt-jackson for all types, to NEVER process getters and setters, and ONLY use fields?
The text was updated successfully, but these errors were encountered: