Thank you very much for that response.
However, while the concept of default heuristics is a bit clearer to me
now, the heuristics itself seems to be a little hard to predict, and, as
you say fragile. I asked this question because I'm working on a code base
that suddenly stopped working properly because of this fragility. The
project uses Spring Boot, so I initially suspected the problem was caused
by some underlying autoconfiguration. However, it turned out to be a
problem with how the default mode works in Jackson as it's rather
unpredictable.
In the code base, there are classes structured similarly to the following
(ignore for now whether the domain is well represented):
public class abstract Book {
private Object content;
protected Book(String code, Object content) { ... }
public Object getContent() { ... }
}
public class FictionBook extends Book {
@JsonCreator
public FictionBook(Object content) {
super("fiction-code", content);
}
}
FictionBook class' constructor annotated with @JsonCreator has always
worked under delegating mode. However, after adding dependency to Jackson's
XML module, the code base started breaking as the constructor began running
in properties mode. I'm just not sure what exactly changed as the classes
in question remained untouched. What did the ObjectMapper find different to
run the JsonCreator in a different mode in this case?
--
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 post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.