aspose file tools*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes JAXB - Named Complex Type is converted to Java content interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "JAXB - Named Complex Type is converted to Java content interface" Watch "JAXB - Named Complex Type is converted to Java content interface" New topic
Author

JAXB - Named Complex Type is converted to Java content interface

Rajani Gummadi
Ranch Hand

Joined: Dec 17, 2010
Posts: 48
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




[Thumbnail for JAXB.JPG]

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
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!
 
wood burning stoves
 
subject: JAXB - Named Complex Type is converted to Java content interface