Skip to content

Dynamically change/delete registered modules #5048

Answered by cowtowncoder
shvydkov asked this question in Q&A
Discussion options

You must be logged in to vote

Short answer: No. And not really possible to do with the architecture.

Longer answer differs a bit between current Jackson 2.x (no -- there's no way to remove modules) and 3.x (can remove during building; or rebuild()).

But basically Modules make kinds of changes that cannot be dynamically modified once ObjectMapper is in use.

So if you want to have different modules (or differently configured), you need separate mappers.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@pjfanning
Comment options

@cowtowncoder
Comment options

Answer selected by shvydkov
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants