users@jaxb.java.net

RE: xjc:simple - Plural (not suitable for other languages)

From: Matthew Wise <mwise_at_mango-solutions.com>
Date: Tue, 6 Aug 2013 16:43:46 +0000

If I understand your situation correctly, you can customise the JAXB XJC generation of Java classes using <xsd:appinfo> and <jaxb:property> within your XSD as below:

<xsd:element name="job" type="Job" minOccurs="0" maxOccurs="unbounded">
       <xsd:annotation> <!-- Only required to customise the Java variable name of the list -->
              <xsd:appinfo>
                     <jaxb:property name="jobs" />
              </xsd:appinfo>
       </xsd:annotation>
</xsd:element>

Hope this helps!
Matt Wise

From: Markus Mitterauer [mailto:markus.mitterauer_at_generali.at]
Sent: 06 August 2013 17:25
To: users_at_jaxb.java.net
Subject: xjc:simple - Plural (not suitable for other languages)

Hello,

I sought for a solution with which XJC generates a class for "SCHADEN" from the given XSD defintion (which it does not by default):

        <xsd:element name="SCHADEN" type="omds:SCHADEN_Type" abstract="false">
                <xsd:unique name="PK_SCHADEN_BETEILIGTER">
                        <xsd:selector xpath="./omds:SCHADEN_BETEILIGTER"/>
                        <xsd:field xpath="@BetLfnr"/>
                </xsd:unique>
        </xsd:element>
        <xsd:complexType name="SCHADEN_Type">
                ...
        </xsd:complexType>

The full XML schema:
        (from http://www.vvo.at/omds-version-2.6-00/index.php)


I found out that "xjc:simple" does exactly what I was looking for.
        http://jaxb.java.net/2.1.2/docs/vendorCustomizations.html#simple


But (unfortunately) "xjc:simple" has a little blemish for me:
since the element names in the given XML schema are in german language, the pluralisation applied by "xjc:simple" results in some strange field names in the generated classes.

I would greatly appreciate an option to turn of pluralisation with the "xjc:simple" feature.


kind regards,
Markus Mitterauer
-----------------------------
VIS-ST-VS
Elektronische Verkaufssysteme

Generali VIS Informatik GmbH
1220 Wien, Kratochwjlestr. 4

fon: +43 1 53401 -13427
fax: +43 1 5320949 -13427
-----------------------------

--
LEGAL NOTICE
This message is intended for the use of the named recipient(s) only and may contain
confidential and / or privileged information. If you are not the intended recipient, please
contact the sender and delete this message. Any unauthorised use of the information
contained in this message is prohibited.
Mango Business Solutions Limited is registered in England under No. 4560258 with its
registered office at Suite 3, Middlesex House, Rutherford Close, Stevenage, Herts, SG1 2EF,
UK.
PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING THIS EMAIL