Skip to content
This repository has been archived by the owner on Aug 5, 2018. It is now read-only.

Create withNew methods for choices #7

Open
GoogleCodeExporter opened this issue Nov 24, 2015 · 0 comments
Open

Create withNew methods for choices #7

GoogleCodeExporter opened this issue Nov 24, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

When we have some structure like this:


 * <pre>
 * &lt;complexType>
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;choice maxOccurs="unbounded">
 *         &lt;group ref="{http://www.w3.org/1999/XSL/Format}marker_List"/>
 *         &lt;group ref="{http://www.w3.org/1999/XSL/Format}block_List"/>
 *         &lt;group ref="{http://www.w3.org/1999/XSL/Format}neutral_List"/>
 *         &lt;group ref="{http://www.w3.org/1999/XSL/Format}float_List"/>
 *         &lt;group ref="{http://www.w3.org/1999/XSL/Format}footnote_List"/>
 *       &lt;/choice>
 *       &lt;attGroup ref="{http://www.w3.org/1999/XSL/Format}inheritable_properties_List"/>
 *       &lt;attribute name="flow-name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>


JAXB generates this structure:


    @XmlElements({
        @XmlElement(name = "block", type = Block.class),
        @XmlElement(name = "multi-properties", type = MultiProperties.class),
        @XmlElement(name = "wrapper", type = Wrapper.class),
        @XmlElement(name = "retrieve-marker", type = RetrieveMarker.class),
        @XmlElement(name = "footnote", type = Footnote.class),
        @XmlElement(name = "marker", type = Marker.class),
        @XmlElement(name = "float", type = Float.class),
        @XmlElement(name = "multi-switch", type = MultiSwitch.class),
        @XmlElement(name = "list-block", type = ListBlock.class),
        @XmlElement(name = "table", type = Table.class),
        @XmlElement(name = "block-container", type = BlockContainer.class),
        @XmlElement(name = "table-and-caption", type = TableAndCaption.class)
    })
    protected List<Object> markerOrBlockOrBlockContainer;


I would be very very useful to have one withNew method for each choice, in 
order to add new elements to markerOrBlockOrBlockContainer and hide this 
List<Object> type.

Best regards,
  Ricardo

Original issue reported on code.google.com by [email protected] on 11 Jun 2011 at 4:48

Attachments:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant