It might be tempting to call com.xpn.xwiki.objects.classes.PropertyClass#setNumber to reorder properties in a class, but this is likely to create inconsistencies as the fields are stored in a LinkedHashMap which is not reordered when calling this method. What's more, nothing prevents someone from calling setNumber with the same number for several properties in a class. This method should probably be updated to allow this usage, or a new api to reorder fields should probably be introduced. |