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;
}
개체를 포함하는 다른 클래스는 내가 어떻게 name
및 인 myObject 목록 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
도움이 될만한 도움이됩니다.