77.9. 格式化的 XML marshalling (pretty-printing)
使用用户 化打印选项
可以在 marshalling 时输出格式良好的 XML:
<dataFormats> <jacksonxml id="jack" prettyPrint="true"/> </dataFormats>
在 Java DSL 中:
from("direct:inPretty").marshal().jacksonxml(true);
请注意,有 5 个不同的 overlay jacksonxml ()
DSL 方法,其支持用户 打印选项
与其他 unmarshalType
、jsonView
等设置相结合。