Can JAXB create a class property read-only?

Is there a way for jaxb to create only getter (no setter) for the class property generated from the element tag in the xsd file (i.e. an element of type xs: integer)? How to get a property of a primitive type const (that is, one that is generated from an element of type xs: int)?

+6
source share
1 answer

It is common practice to convert your generated JAXB objects to correctly defined domain model classes. This way, you have full control over how model classes behave in your code, and if XSD changes you don't get a lot of space in your code that breaks. You only need to update your converter class, as this should be the only place you rely on the generated JAXB classes.

0
source

Source: https://habr.com/ru/post/901798/


All Articles