ライブラリに接続しています。私は得るList<List> foodItemsList
foodItemsListJackson を使用してシリアル化するにはどうすればよいですか? これは、GET の処理中に発生しています。
Jackson/Restlet を使用してオブジェクトをシリアル化する方法は理解しましたが、リストについてはわかりません。
ここにある単一のオブジェクトの場合、私は何をしますか
@Get("json")
public Representation represent(Variant variant) throws ResourceException {
    :
    ObjectMapper mapper = new ObjectMapper(); 
    String myFinString = mapper.writeValueAsString(profileSupportedInfo);
    :
    return myFinstring
}
profileSupportedInfo のメンバー データのゲッター セッターは、私が提供するものです。
マッパーオブジェクトを作成する前に、私が行う呼び出しは次のとおりです
List<List> totalfoodItem = someMemberFunc();
ObjectMapper mapper = new ObjectMapper
// my question - how do I serialize totalFoodItem
totalFoodItemJSON での の推奨表現は次のとおりです。
{
 "food":[
       {"name":"apple","img_loc":"123_apple.jpg","energ":210,"food_unit":"1"},
       {"name":"rice","img_loc":"134_rice.jpg","energ":123,"food_unit":"100 gm"},
       :
   ]
}
何が欠けている/理解できないのですか? ありがとうございました