<requests>
<request id="246">
<employee id="40350">Michael Daniels</employee>
<start>2012-10-20</start>
<end>2012-10-25</end>
<created>2012-10-11</created>
<status lastChanged="2012-10-24" lastChangedByUserId="2270">superceded</status>
<type id="4">Vacation</type>
<amount unit="hours">2</amount>
<notes>
<note from="employee">Having wisdom teeth removed.</note>
<note from="manager">Get well soon</note>
</notes>
</request>
<request id="248">
<employee id="40350">Michael Daniels</employee>
<start>2012-11-12</start>
<end>2012-11-15</end>
<created>2012-10-19</created>
<status lastChanged="2012-10-30" lastChangedByUserId="2270">superceded</status>
<type id="4">Vacation</type>
<amount unit="hours">2</amount>
<notes>
<note from="employee">My dog ate my homework so I can't come to work.</note>
</notes>
</request>
xstream がこれをどのようにセットアップすることを望んでいるかを理解するのに恐ろしい時間を過ごしています....これは私が現在行っていることです:
class Holder
{
Requests requests;
@XStreamAlias("requests")
public static class Requests
{
List<Request> requests = new ArrayList<Request>();
}
@XStreamAlias("request")
public static class Request
{
int id;
Employee employee;
String start;
String end;
String created;
Status status;
Type type;
Amount amount;
Notes notes;
}
public static class Employee
{
int id;
String content;
}
public static class Status
{
String content;
String lastChanged;
int lastChangedByUserId;
}
public static class Type
{
int id;
String content;
}
public static class Amount
{
String unit;
int content;
}
public static class Notes
{
List<Note> notes = new ArrayList<Note>();
}
public static class Note
{
String from;
String content;
}
}
xstreamがbove xmlからそれを埋めるように構造を設定する方法を誰かが理解するのを手伝ってくれませんか?