Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

variations in generated classes  RSS feed

Stuart Rogers
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I'm trying to do a 'round-trip' ie starting with annotated Java classes, generating a schema with jaxb2-maven-plugin->schemagen then generating java classes from the schema using jaxb2-maven-plugin->xjc and in comparing the originals I discover some discrepencies. I have an adapter for changing XmlGregorianCalendar to JodaTime's DateTime baked into my bindings.xjb

The original files ExperimentA, B and C have a org.joda.time.DateTime attribute annotated three slightly different ways



generating the schema results in



running xjc generates new classes that slight different than each other



with some extra generated classes appearing like DateTime, Adapter1 , etc

Notice only the third method produces a type of xs:dateTime which ties in with the bindings.xjb file.
And only the third method results in a generated class that imports the correct DateTime class.

a: how can I get to where no extraneous classes get generated ie Adapter1 etc, and how can I
get my generated classes to both import org.joda.time.DateTime
and have only the " @XmlElement(name = " annotation? ie:


Still-learning Steve
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!