Unmarshalling in a custom Java class has its advantages and disadvantages. This gives you a nice static typing, but it's good, static. Javadoc for @JsonAnySetter assumes that it is similar to JAXB @XmlAnyElement , but unlike @XmlAnyElement data objects do not contain name information, so this is a one-way street.
if you need to handle dynamic JSON streams, you need to bite the bullet and use Map or JsonNode .
source share