【问题标题】:what's the alternative method for typeFactory.arrayType(xxx)?typeFactory.arrayType(xxx) 的替代方法是什么?
【发布时间】:2011-05-25 13:34:26
【问题描述】:

作为杰克逊 1.8,不推荐使用 typeFactory.arrayType(xxx),我应该使用什么方法来表达类型安全的数组,例如 int[]?

【问题讨论】:

    标签: json jackson


    【解决方案1】:

    您需要使用 ObjectMapper.getTypeFactory() 访问 TypeFactory,然后调用实例方法。需要进行更改以允许某些类型的类型处理覆盖(特别是针对 Scala 扩展模块)。 或者,如果您无权访问 ObjectMapper(或相关对象、序列化器/反序列化器提供程序),则可以实例化一个独立的 TypeFactory

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-13
      • 2015-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多