As part of continuing work to more seamlessly support addition of argument name information (by JDK8, paranamer, or other mechanism), it makes sense to allow auto-detect of creators even without @JsonCreator
annotation if:
- All parameters have name (implicit or explicit), or are marked as injectable AND
- There are no other visible constructors AND
- There is no default (no-arg) constructor (which otherwise would be detected regardless of visibility)
In addition, there is one practical limitation due to existing resolution rules:
- Single-argument constructor will default to "delegating" constructor, so implicit names are only used if
@JsonCreator
is used to indicate "property-based" constructor use, or explicit names.
Note, too, that language modules (like jackson-module-scala
) may refine rules for more accurate detection of the "main" constructor; this functionality refers to vanilla handling for Java.