360.5. unmarshalling 用法

unmarshalling 使用 InputStream 来读取数据。

每行都会产生:

  • 包含其中所有值的列表(以Map 选项为 false);
  • 包含标头索引的所有值的映射(使用 true为Map 选项)。

所有行都可以:

  • 一次收集到列表(带有 falselazyLoad 选项);
  • 即时使用迭代器(lazyLoad 选项 )

360.5.1. usage 示例:将 CSV 格式合并到带有自动标头的映射中

<route>
    <from uri="direct:input"/>
    <unmarshal>
        <univocity-csv headerExtractionEnabled="true" asMap="true"/>
    </unmarshal>
    <to uri="mock:result"/>
</route>