Linked Questions

Popular Questions

JAXB Change Default Naming Convertor

Asked by At

With the help of JAXB, I want to do some marshaling and unmarshaling by reusing some existing XML/classes with no JAXB type/element annotations.

Is it possible to change default JAXB naming mapping configuration to map all tags/fields like that "firstName->FirstName" without introducing any annotations?

I mean these class fields (note: they start with small letter)

class Person {
    String firstName;
    String lastName; 
}

to map to that XML (note: they start with the capital letter):

<Person>
    <FirstName>John</FirstName>
    <LastName>Doe</LastName>
</Person>

Related Questions