如何在Spring集成路线中集成Jaxb2Marshaller?

时间:2018-08-09 22:12:32

标签: spring spring-integration spring-oxm

  1. 创建了Jaxb2Marshaller对象。
  2. 需要将Java POJO转换为XML(编组)。

在集成路径中集成Jaxb2Marshaller时需要帮助。

代码流:-

200

如何在transform()步骤中添加Jaxb2Marshaller?

1 个答案:

答案 0 :(得分:0)

有一个现成的变压器可以使用:

.transform(new MarshallingTransformer(jaxbMarshaller()))

https://docs.spring.io/spring-integration/docs/current/reference/html/xml.html#xml-marshalling-transformer

如何创建Jaxb2Marshaller,您可以查阅Spring Framework文档:

https://docs.spring.io/spring/docs/current/spring-framework-reference/data-access.html#oxm-jaxb2