77.4. 使用动态类名称从 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:
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>