eclipse-ee4j / eclipse-ee4j/jaxb-ri

XJC (in simple mode) should avoid JAXBElement for substitutable elements

Open
#720 10 comments 0 reactions 1 assignee Claimed by @glassfishrobot View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.