-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds annotations to customize field names during Bean serialization #406
Conversation
4538c95
to
a9f0742
Compare
a9f0742
to
a6c68a0
Compare
Nice work on the the project's first attempt with annotations!
|
|
35d05b0
to
df7c7e4
Compare
No preference on the name either, unless someone comes up with something better, and OK to proceed with JSONPropertyIgnore, since there are people who will use it. |
df7c7e4
to
74b9a60
Compare
added in the skip over keys that start with a lowercase, but only in the event that the annotation is not present. |
Accepted, starting 3 day comment window. |
4244e84
to
b20f76e
Compare
…e tagged with the new JSONPropertyName annotation. Also updates the javadoc to reflect the new name allowances
b20f76e
to
a509a28
Compare
What problem does this code solve?
Allows users to customize key names when performing Java Bean conversion into a
JSONObject
. This is in reference to #401. This PR also has support to force the serializer to ignore bean getters if a specific annotation is provided.Risks
LOW. Should not affect existing programs. If an existing program does require a field to be ignored, then the new annotation can be used to force it out of the resulting JSONObject result.
Changes to the API?
Two (2) new annotation classes were created that allow customization of field names when used on Bean getters.
Example:
the output of the above JSONObject should look like this:
Will this require a new release?
yes
Should the documentation be updated?
No, This PR updates both the Javadoc and the README where needed.
Does it break the unit tests?
No. New tests have been added to support the new annotations.
Was any code refactored in this commit?
Yes. Some private functions were created to supplement the
populateMap
method and support the new Annotations.Review status
ACCEPTED