1

I want a custom sequence in my xml response rather than alphabetical. It's mostly alphabetical order but with few exceptions. So, I ended up using propOrder in @XmlType annotation as a solution.

Now the problem is in few classes I've around 50 fields. Adding a propOrder for such classes is hectic to code. If there is anyway propOrder values can be generated with default values, lets say in alphabetical order, I will be able change the sequence later.

Any solution would be appreciated, thanks.

Aldeguer
  • 821
  • 9
  • 32
  • For now, I've written a standalone java program to read and load java file provided by the user. Get all the fields using reflection and generate `propOrder` for the same class, reorder it as desired. Please let me know if there is a standard solution for this. – Poorvik Angadi Oct 15 '17 at 07:48

0 Answers0