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

XJC Javadoc generation : locale is ignored #1801

Closed
laurentschoelens opened this issue May 3, 2024 · 2 comments
Closed

XJC Javadoc generation : locale is ignored #1801

laurentschoelens opened this issue May 3, 2024 · 2 comments

Comments

@laurentschoelens
Copy link
Contributor

See highsource/jaxb-tools#538

I'm trying to generate Java classes starting from an XSD.
The XSD contains documentation in multiple languages:

<xs:annotation>
    <xs:documentation xml:lang="de">DE: person description</xs:documentation>
    <xs:documentation xml:lang="en">EN: person description</xs:documentation>
    <xs:documentation xml:lang="fr">FR: person description</xs:documentation>
    <xs:documentation xml:lang="it">IT: person description</xs:documentation>
</xs:annotation>

In the pom.xml I defined the locale to be german:

    <build>
        <plugins>
            <plugin>
                <groupId>org.jvnet.jaxb</groupId>
                <artifactId>jaxb-maven-plugin</artifactId>
                <version>4.0.3</version>
...
                <configuration>
                    <locale>de</locale>
                </configuration>
            </plugin>
        </plugins>
    </build>

The documentation in the generated Java classes is set to italian, the last entry of <xs:documentation>.

public class Person {

    /**
     * IT: name description
     * 
     */
    @XmlElement(required = true)
    protected String name;

An example micro-project can be found here

@laurentschoelens
Copy link
Contributor Author

@ggiambo

@laurentschoelens
Copy link
Contributor Author

@ggiambo :

The documentation tag inside the annotation tag seems to be only 0..1, so multiple documentation tag is invalid definition and only the last is parsed by XJC during XSD-JAVA generation :
See com.sun.tools.xjc.reader.xmlschema.bindinfo.BindInfo

public final class BindInfo implements Iterable<BIDeclaration> {
private BGMBuilder builder;
@XmlLocation
private Locator location;
/**
* Documentation taken from {@code <xs:documentation>s}.
*/
@XmlElement(namespace=XMLConstants.W3C_XML_SCHEMA_NS_URI)
private Documentation documentation;

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

No branches or pull requests

1 participant