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

Add a DeserializerFeature that disables use of final fields for setting values #564

Closed
smeder opened this issue Sep 29, 2014 · 1 comment

Comments

@smeder
Copy link

smeder commented Sep 29, 2014

Discussion here: FasterXML/jackson-module-afterburner#42

It would be great if a new flag "ALLOW_FINAL_FIELDS_AS_SETTER" could be added. This flag would indicate if the code should try to set values on final fields. To preserve existing behavior this flag should default to true.

@cowtowncoder
Copy link
Member

Lolz. Look at that: #190. So I added this feature already back in 2.2, as MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS.

Now, as to it being a MapperFeature: this is because all DeserializationFeatures and SerializationFeatures being available for change on per-call basis; whereas MapperFeature must be set once before using ObjectMapper. And since pruning of properties is something that can not be undone or changed, it belongs into this more fundamental set of settings, even if only applicable to deserialization.

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

No branches or pull requests

2 participants