mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-17 07:50:52 -07:00
Adds annotation to support custom field names during Bean serialization
This commit is contained in:
parent
d402a99fd8
commit
74b9a60f98
4 changed files with 302 additions and 35 deletions
12
README.md
12
README.md
|
@ -40,6 +40,18 @@ by this package.
|
|||
JSON Pointers both in the form of string representation and URI fragment
|
||||
representation.
|
||||
|
||||
**JSONPropertyIgnore.java**: Annotation class that can be used on Java Bean getter methods.
|
||||
When used on a bean method that would normally be serialized into a `JSONObject`, it
|
||||
overrides the getter-to-key-name logic and forces the property to be excluded from the
|
||||
resulting `JSONObject`.
|
||||
|
||||
**JSONPropertyName.java**: Annotation class that can be used on Java Bean getter methods.
|
||||
When used on a bean method that would normally be serialized into a `JSONObject`, it
|
||||
overrides the getter-to-key-name logic and uses the value of the annotation. The Bean
|
||||
processor will look through the class hierarchy. This means you can use the annotation on
|
||||
a base class or interface and the value of the annotation will be used even if the getter
|
||||
is overridden in a child class.
|
||||
|
||||
**JSONString.java**: The `JSONString` interface requires a `toJSONString` method,
|
||||
allowing an object to provide its own serialization.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue