Reputation: 96581
When creating new annotation
public @interface Invariant {
String min();
String max();
String Default();
String freeform();
}
Elements appear in what seems to be alphabetical order. I wonder if there is a way to force the same order as established in the annotation itself?
I get
@Invariant(Default = "", freeform = "", max = "", min = "")
I'd like to get
@Invariant(min = "", max = "", Default = "", freeform = "")
Upvotes: 2
Views: 91
Reputation: 236170
The order of the elements in an annotation is irrelevant, it makes no sense at all to force an ordering. Don't waste your efforts on this, it's not worth it - and anyway, you can't force an ordering, it's just not possible.
Upvotes: 1
Reputation: 49935
No, I doubt if there is a way to force the order of the attributes.
Upvotes: 0