Skip to content

Deserializing into Map<String, Object> based on a map-global type property #4341

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

You must be logged in to vote

Deserializers are only given access to JSON sub-tree to specific to value they are to work on, and need to delegate "down" to values they reference. But there is no access to possible "parent" path (value being constructed -- if one already exists) or "parent" deserializer that called it.

I guess there are 2 types of delegation in existence:

  1. Delegation along hierarchy: Map deserializer delegates to Map value deserializers (and KeyDeserializer)
  2. Possible delegation "within" value: this is where BeanDeserializerModifier comes in.

Both can be used and are supported. The problem is more in that there is limited interaction between deserializers.

Having said that, JsonParser has method for ge…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@herkrath
Comment options

@cowtowncoder
Comment options

Answer selected by herkrath
@cowtowncoder
Comment options

@herkrath
Comment options

@cowtowncoder
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants