Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.5
-
Fix Version/s: None
-
Component/s: Deserializer
-
Labels:None
-
Number of attachments :
Description
There are use cases where it would be useful to have "setters" that take more than one arguments: for example, there are data formats where type information for a property is stored within another property and not within property object itself. This could be handled by using 2-parameter "setter" method.
Such setters would need to
1. Be annotated with @JsonSetter method
2. Have @JsonProperty annotations for every parameter to give logical property name to bind (since parameter names are not stored in class byte code)
In future it might also make sense to consider adding something like @JsonContext or @JsonInject to allow injecting non-property information (for example, ObjectMapper or DeserializationContext reference); but for now, simple multi-argument setter would be enough.
Implementation may not be trivial, but similar bundling is already handled for creator (constructor) parameters so this seems doable.
Should be implemented for 1.7.0, very useful for ensuring co-constraints.