Pascal Gelinas
unread,Dec 20, 2013, 9:56:28 AM12/20/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to us...@jackson.codehaus.org, jackso...@googlegroups.com
Cross-posting on google groups, it is the new communication channel.
I believe the methods you are looking for instead are
ObjectMapper#readValue(JsonParser, Class<T>) with ObjectNode#traverse()
which returns the JsonParser to use with the first method.
ObjectMapper#convertValue will work, but it will serialize the
ObjectNode structure in an intermediate TokenBuffer then parse/data-bind
into result value type, so definitely sub-optimal.
Hope this helps,
Pascal G�linas
On 12/19/2013 05:31 PM, Ransom Briggs wrote:
> I was reading the documentation for ObjectMapper.convertValue (in
> 1.9.4 api) and it says that it is a "Convenience method for doing
> two-step conversion from given value, into instance of given value
> type. This is functionality equivalent to first serializing given
> value into JSON, then binding JSON data into value of given type, but
> may be executed without fully serializing into JSON."
>
> If I have something that is already and ObjectNode that I want to
> convert to a given value type is there a better method to call? or
> will convertValue recognize that I already have converted it to JSON
> already and skip the first step?
>
> Thanks,
> Ransom