62.4. 使用动态类名称从 XML 总结到 POJO
如果您使用 jackson 将 jackson 取消marshal XML 到 POJO,那么您现在可以在消息中指定一个标头,指出哪个类名称为 unmarshal to。
如果消息中存在该标头,则标头有关键 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:
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);
JacksonDataFormat format = new JacksonDataFormat();
format.setAllowJmsType(true);
或来自您将其配置为的 XML DSL
<dataFormats> <jacksonxml id="jacksonxml" allowJmsType="true"/> </dataFormats>
<dataFormats>
<jacksonxml id="jacksonxml" allowJmsType="true"/>
</dataFormats>