Problem:
The code has been labeled
@JSONField(name = "Attrs")
Private String ABC;
Public String Geta () {
Return ABC;
}
public void SetA (String ABC) {
THIS.ABC = ABC;
}
When sending a message, it is found that the JSON message received by the message is that the field of ABC corresponds to a.
Workaround:
When we find this problem, I think it should be the title of Get and set function name, change it to GETABC (), SETABC (), and send the message again, we will find that the corresponding field of ABC is attrs.
Reason:
Consult Daniel, look at the framework code, and do not see too clearly.
Presumably because the Java object is converted to a JSON string, there may be precedence, based on the name after the Get function, which is the example of a to match the member variable, if not found, the field name is a; If found, that is, if ABC, then can find, match on Attrs, The field name is Attrs.
A Java object converted to a JSON string is not able to get the corresponding field name