How do I use a custom order when using FlexJSON 2.1 with Play Framework? Right now I have:
public String toJsonString() {
// Include id & name, exclude all others.
JSONSerializer ser = new JSONSerializer().include(
"id",
"firstName",
"lastName",
"email",
"authToken",
"dob",
"home_zip",
"gender",
).exclude("*").prettyPrint(true);
return ser.serialize(this);
}
And it prints out in alphabetical order.
I found this SO post, but I don't have any class defined as @XMLRootElement. How do I tell FlexJSON to use a custom ordering?