Skip to content

Add AnnotationIntrospector.resolveSetterConflict(...) to allow custom setter conflict resolution #1044

@cowtowncoder

Description

@cowtowncoder

(note: inspired by #1033)

Although Jackson tries to figure out reasonable rules for precedence of setter to use, in case of overlap, it is not possible to resolve all kinds of application/usage-specific cases. So to allow plugging in custom handling, let's add a mechanism overridable via AnnotationIntrospector that makes it possible to resolve at least some of most common cases.

In addition, JacksonAnnotationIntrospector should implement very basic heuristics, where:

  • Primitive type has higher precedence than non-primitive
  • For other types, java.lang.String has precedence over other non-primitive types.

This logic is overridable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions