Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating JAXB classes with custom class names

Tags:

java

jaxb

I have a schema which names all its elements and complexTypes in capital letters and so all my class names are also in caps.

Can you let me know how to capture this and name the classes in CamelCase?

Ex: Snippet of XSD :

<xs:element name="REGISTRATION_DATE">
    <xs:complexType mixed="true">
        <xs:attribute name="UNIT" />
    </xs:complexType>
</xs:element>

Currently it is generating as : REGISTRATIONDATE . But I would like to generate class as : RegistrationDate .

Regards, Satya

like image 704
Satya Avatar asked Oct 26 '22 02:10

Satya


1 Answers

There is a plugin for XJC to do this - the CamelCase Always plugin.

like image 157
skaffman Avatar answered Nov 15 '22 05:11

skaffman