0
我試圖處理以下XML映射的XML類:如何將自定義的JAXB
<?xml version="1.0" encoding="UTF-8"?>
<operation name="GET_NOTES">
<result>
<status>Success</status>
<message>Notes details fetched successfully</message>
</result>
<Details>
<Notes>
<Note URI="http://something/24/notes/302/">
<parameter>
<name>ispublic</name>
<value>false</value>
</parameter>
<parameter>
<name>notesText</name>
<value>Note added to the request</value>
</parameter>
...
</Note>
...
</Notes>
<Details>
</operation>
這有許多無用的東西,所以我試圖映射成類似:
public class Notes {
public List<Note> notes;
}
public class Note {
public String notesText; //value of parameter with name notesText
public Boolean isPublic; //value of parameter with name ispublic
}
JAXB可以這樣做嗎?你會怎麼做?
will notesText包含參數中value標籤內的字符串嗎? – GriffinHeart