0
速度でオブジェクトプロパティにアクセスしたいベロシティテンプレート内のリストのオブジェクトプロパティにアクセス
私は次のことがあります。
public class myObject(){
@key("name")
private String name;
@key("other")
private String other;
/*
getters and setters here
*/
}
それから私は、myObjectというのリストが含まれている別のクラスが
public class testClass(){
@key("objectList")
private List<myObject> randomlist;
}
どのように私は、myObjectというリストのname
とother
にアクセスできるオブジェクトがありますか? 私の速度は以下のように見えますが
#macro(getListContent $tag $tag2 $listName)
#foreach($object in [0..$listName-size])
<$tag1>$object-name</$tag1>
<$tag2>$object-other</$tag2>
#end
#end
機能しないと最終的に私は
#getListContent("name" "other" $testClass.get("objectList"))
を持っていますが、これは動作しません。注釈を使用してマップされたオブジェクトプロパティにアクセスするにはどうすればいいですか@key
ヘルプが役立ちます。