Click here to Skip to main content
15,887,990 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Jackson does not provide a tool for generating Jackson classes from XSD or JSON, as JAXB does for a specific XSD.

The JAXB class generator was used to generate a set of classes for the specified XSD schema. For polymorphic types, for example, JAXB provides the following annotation to identify the name based on the name of an XML element.

What I have tried:

@XmlElements({
    @XmlElement(name = "Dog", type = Dog.class),
    @XmlElement(name = "Cat", type = Cat.class)
})
protected List<Animal> animal;


Can such courses be offered in Jackson? Specifically, determining the type based on the name of an XML element.
Posted
Updated 17-Oct-22 0:04am
Comments
Dave Kreskowiak 17-Oct-22 9:26am    
In 20 years, you are the first person I know of to ask anything about Jackson.

Jackson itself is a bit of an outdated concept as it predated OOP, and even the more modern JAXB has been removed from support as of Java SE 11.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900