我的Scala对象
class Product(@BeanProperty var productName: String,
@BeanProperty var source: String,
@BeanProperty var category: String,
@BeanProperty var comments: ArrayBuffer[String]) {
}
使用Jackson API
val p = new Product("","","",list with 1000 values)
var objectMapper = new ObjectMapper
println(objectMapper.writeValueAsString(p))
输出:
"productName":"Apple iPhone 6","source":"dump_gsm_arena","category":"Mobile","comments":**{"empty":false,"traversableAgain":true}**}
使用Play和JsonLift Api获得相同的结果