Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

JAXB - Named Complex Type is converted to Java content interface

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I read somewhere about JAXB binding rules, which says that a Named complex type is mapped toa java content interface. I have taken the xsd from Ivan's notes as below



Here both Person and KompisRelation are complex types, but when I ran xjc against this schema I do see four java files generated

1) ObjectFactory.java 2) KompisRelation.java 3)Person.java 4) package-info.java

But none of these are actually any interfaces. Am I missing anything here ?

Also, I see this table, what is Java content interface and what is Java element interface

JAXB.JPG
[Thumbnail for JAXB.JPG]
JAXB Binding
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I think the difference is in how the generated classes are annotated with JAXB annotations.
Try modifying the XML schema as to contain a complex type that has no corresponding global element type and generate JAXB classes.
Then examine the annotations on the different classes.
Best wishes!
 
grapes are vegan food pellets. Eat this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic