eclipse-ee4j / eclipse-ee4j/jaxb-ri
XJC (in simple mode) should avoid JAXBElement for substitutable elements
Open
Component: xjc
Priority: Major
Type: New Feature
- Dominant language
- Java
- Stars
- 222
- Forks
- 131
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 9
Description
In OOP there's a very common pattern where a Container can have an abstract
Component with concrete subtypes (see AbstractComponent.gif). In XSD one way to
model this pattern is to use substitution groups. I'm attaching example schema
AbstractComponent.xsd. JAXB can deal with this with XmlElementRef w/o resorting to
JAXBElement (which clutters domain classes). I'm attaching quick and dirty patch
for XJC.
#### Environment
Operating System: Windows XP
Platform: All
#### Affected Versions
[2.1.12]
Contributor guide
Assessment
This issue has not been assessed yet.