Community
Participate
Working Groups
When unmarshalling to subclasses, they may be declared using @XmlSeeAlso. When they are not known beforehand, one has to put them into the JAXBContext. (This requirement may come e.g. for pluginable applications.) My suggestion is to scan the classes on classpath with Jandex and use that to retrieve subclasses of particular class. It brings few questions, like, how to get the jars on the classpath to give Jandex to scan etc. But I assume it's solvable, as CDI RI (Weld) can do that. It can also filter out some packages to speed up. Maybe Jandex can't do all the things necessary - maybe CDI could be reused for that? CDI developer just told me that it's the container what does the Jandex calls, and provides the index object for particular deployment to Weld. Anyway, having MOXy doing this would be cool. Regarding performance - Jandex can store index files at given location, usually next to .jar, and after that it reads the file pretty quickly. So user could specify a location to store the indexes to, for his app. Could go next to jar, or to /tmp/moxy/jandex, or app's root dir... Jandex index can also be created at build-time, eg. there's a Maven plugin. Anyway, it should be optional, maybe through using another annotation like @XmlScanForSubclasses, or, not to clutter the annotation space, perhaps some MOXy's annotation's parameter. Thanks for considering.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink