简体   繁体   中英

How to control the JAXB enumerations that are generated

I have a general question and will provide more information if required. I have a schema that generates multiple enumerations. I was able to increase the number of enumerations using :

    typesafeEnumMaxMembers="34431"

That solves the immediate problem of creating the enumerations. But what happens is that it generates, in one class, over 65k of constants. That is way over the limit for java. How could I use another data structure for this data? I have a schema that omits the enumerations but it still appears to generate them.

My goal here is to see if anyone has run into this type of thing. I prefer to not change the schema in any way if possible. I have read through the JAXB documentation and tried various things but it doesn't seem to solve my problem.

Any insight would be greatly appreciated.

Thank you,

Dave

Generally, if JAXB isn't able to generate an enum due to the size of the dictionary being too large, it will create a text field instead.

If you want to convert the text value to something else in the bean, you can always use an XMLAdapter to convert the value to some custom type that you like. You need to use the @XmlJavaTypeAdapter annotation for the respective getter/field.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM