Hi all.
Given that you can use Jackson to unmarshall to "unmarshalTypeName="
(which works for a 1:1 mapping) how does one go about "dynamically
unmarshalling" a JSON document to "N-possible classes?"
eg, full protocol work, based on a piece of the JSON itself.
I can build something using the java DSL, or letting Jackson unmarshal
to a Map and then building POJOs by hand, but I'm wondering if there's
a better way, ideally, using the Spring XML syntax.
Something like ..
<route id="incomingJSON">
<from ref="jsonListener" />
<unmarshal ref="jsonDF"
unmarshalTypeRef="com.mypackage.ProtocolHandler"
method="getPOJOClass"/>
<to ref="seda:routeMessage" />
</route>
This way I can use a bean to determine which class to map the JSON to,
instead of hardcoding to a single class.
Thanks,
-mox