我正在尝试处理以下 xml:
<?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 是否可行,您将如何处理?