With addition of setCurrentValue()
there's typically need to make 2 class; one to set current value, another to write START_OBJECT
. Further there may be checks that some codecs (like, say, XML one) might want to make related to combination of underlying format element and Java Object it is to represent; these are much easier to make if there is just one call and not a sequence of two.
A related question is whether to do the same with writeStartArray()
, perhaps related to handling of compact arrays of primitives (like for int[]
).