我有这堂课
public class Procedure
{
List<Session> sessions;
//Setter Getter Here
}
public class Session
{
String session;
Date sessionDate
}
会话可以是session1,session2,session3或session4。 假设这是列表的内容
[0]session = "session1", sessionDate = 1999-11-11
[1]session = "session1", sessionDate = 1999-11-21
[2]session = "session2", sessionDate = 1999-12-12
[3]session = "session4", sessionDate = 1999-12-13
我将如何使用Jaxb注释我的方法以生成此xml
<procedure>
<session1>
<sessionDate>1999-11-11</sessionDate>
<sessionDate>1999-11-21</sessionDate>
</session1>
<session2>
<sessionDate>1999-12-12</sessionDate>
</session2>
<session4>
<sessionDate>1999-12-13</sessionDate>
</session4>
</procedure>
请帮助谢谢