Suppose I have a XML:
<root>
<node>
<order-id>4</order-id>
.....
</node>
<node>
<order-id>1</order-id>
....
</node>
</root>
When I unmarshal this xml I want that the List<Node> I get is be sorted with order-id value.
Is there a way using JAXB that I directly get the sorted List?
If you don’t mind Set instead of List, try
works fine. And if Set is not an option, then change Root as