167.6. 動的クラス名を使用した XML から POJO へのアンマーシャリング
jackson を使用して XML を POJO に非整列化する場合、非整列化先のクラス名を示すヘッダーをメッセージに指定できるようになりました。
そのヘッダーがメッセージに存在する場合、ヘッダーにはキー CamelJacksonUnmarshalType
があり、Jackson はそれを POJO クラスの FQN として使用して、XML ペイロードを非整列化します。
For JMS end users there is the JMSType header from the JMS spec that indicates that also. To enable support for JMSType you would need to turn that on, on the jackson data format as shown:
JacksonDataFormat format = new JacksonDataFormat(); format.setAllowJmsType(true);
または、XML DSL から、これを次のように設定します。
<dataFormats> <jacksonxml id="jacksonxml" allowJmsType="true"/> </dataFormats>