One feature that has been requested occasionally has been ability to update properties of existing Objects. That is, given a Bean, bind whatever properties JSON object has and override existing values, but don't bother constructing a new instance. It hasn't been high priority thing to add, but today I realized that it would be rather easy to implement -- and, maybe most importantly, I found a use case of my own for this feature (basically for priority/overrides for config files).
So, I went ahead and implemented this (see
1.6 plans page for more details). Here's how you can use the feature:
Bean bean = new Bean();
// set properties, whatever, and:
new ObjectMapper().updatingReader(bean).readValue("{ \"name\" : \"Jackson\"}");
// 'bean' is also reported by readValue() call, as usual
(as you can see from above, annother related improvement is addition of ObjectReader abstraction -- to
match ObjectWriter that 1.5 added -- it was added to prevent combinatorial explosion
with new configuration settings)
You need to be a member of Jackson JSON User Group to add comments!
Join Jackson JSON User Group