Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to selectively disable simplification #173

Open
sebersole opened this issue Jul 5, 2024 · 1 comment
Open

Ability to selectively disable simplification #173

sebersole opened this issue Jul 5, 2024 · 1 comment

Comments

@sebersole
Copy link

I'm not exactly sure if this is a feature request or a question, but I am not sure of a better place to ask.

I am using the Simplify Plugin and it works outstanding. What I see is that the plugin aggresively simplifies all repeatable choices. Generally this is perfect; however I do have a situation where the order of elements within a choice does matter in my schema. But I have been unable to figure out how to make Simplify Plugin NOT do the simplification in just that case.

Is that possible currently? Or is that something for which you'd consider adding support?

Thanks!

If it helps, the fragment of the schema is this complex-type:

    <xsd:complexType name="many-to-one">
        <xsd:sequence>
            <xsd:choice>
                <xsd:sequence>
                    <xsd:choice>
                        <xsd:sequence>
                            <xsd:sequence>
                                <xsd:choice>
                                    <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
                                    <xsd:element name="join-formula" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
                                </xsd:choice>
                                ...
                            </xsd:sequence>
                            ...
                        </xsd:sequence>
                        ...
                    </xsd:choice>
                    ...
                </xsd:sequence>
                ...
            </xsd:choice>
            ...
        </xsd:sequence>
    </xsd:complexType>

Currently, with Simplify Plugin, XJC produces:

    protected List<JaxbJoinColumnImpl> joinColumns;

    protected List<String> joinFormulas;

In this case, the order is important so I really need the heterogeneous form:

    protected List<Serializable> joinColumnsOrFormulas;

Thanks again!

@laurentschoelens
Copy link
Collaborator

Hi @sebersole

First, thanks for using jaxb2-basics.
It's now part of jaxb-tools project, which was former repository of maven-jaxb2-plugin. See Readme for new location.

To answer your question, you should give a try to the ignored special binding with the simplify prefix bound to simplify namespace : see excluding properties section in wiki.

If you got any more question, feel free to ask (you'll also get more support from new repository location).

Regards
Laurent

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

No branches or pull requests

2 participants