On Mon, Jul 22, 2019 at 8:04 AM Jean Dannemann <[email protected]>
wrote:

> Whats the correct way to instantiate ParameterNamesModule for "constructor
> with all fields" deserialization?
>
>
> It already works for me.. but it works in both ways!.. whats the
> difference of
>
>
> new ParameterNamesModule()
>
> and
>
> ParameterNamesModule(JsonCreator.Mode.PROPERTIES)
>
>
> Aso, I do NOT need to add the -parameters compiler argument for it to work
>
>
> Maybe because I do not have a default noargs constructor declared
>

I think one important thing that may be missing from Javadocs is that this
setting ONLY affects the specific case of 1-argument constructors -- those
are the only cases where there is ambiguity between "delegating" and
"properties-based" creators.
This because "delegating" creator only works with one argument, whereas
"properties" can work with any number (although 0-argument is sort of
pointless).
[note: in theory N-argument creator could work as delegating if there are
`@JacksonInject` annotations, but I think that possibility is currently
ignored].

So perhaps your constructors just have more than 1 argument? If so, choice
makes no difference.

My personal preference is to simply use explicit `@JsonCreator` for
1-argument case, and use no-arguments constructor of Module.

-+ Tatu +-

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jackson-user/CAGrxA27%3DZ4S34Ne9jYbqxfuMuMO4gDuuo2TgE22kW5K9R8MiVA%40mail.gmail.com.

Reply via email to