dev@jaxb.java.net

[Fwd: fastinfoset unmarshaller fix in jaxb] Can Castor do things that JAXB can't?

From: alisamad <alisamad_at_yahoo.com>
Date: Tue, 24 Jun 2008 11:19:01 -0700 (PDT)

Hi,
I am a new user of JAXB 2.0. Previously I used to use Castor to generate
Java Classes from schema files and it seems that Castor can do an important
thing that JAXB can’t do. Please consider the following schema snippet:

<xsd:element name="C#" type="base:ProgLanguage"/>
<xsd:complexType name="Java">
<xsd:complexContent>
<xsd:extension base="base:GoodProgLanguage"/>
</xsd:complexContent>
</xsd:complexType>

Now the base classes are found in different schema files which are imported
in the above schema. Through my experience till now, JAXB creates all
classes mentioned in a schema file like "base:", "xsd:element" and even
classes found in imported schemas . Now my problem is that I can’t touch the
schema. And I don’t want to regenerate base classes ("GoodProgLanguage")
that my "Java" class extends. The only thing I want to generate is the
“Java” class.
In Castor one can specify in the castorbuilder.properties file:
Org.exolab.castor.builder.javaclassmapping=type
The above statement means the following:
The "type" method creates classes for all top-level <complexType>s, or
elements that contain an "anonymous" (in-lined) <complexType>. Classes will
not be generated for elements whose type is a top-level type.
In other words only the “Java” class would be created and nothing else. This
is very important since base classes and element types are not duplicated
and recreated thus conflicts are avoided. It would only give warnings not to
forget to generate the imported schemas.
Am I missing out on something here? Doesn’t JAXB have something like a
castorbuilder.properties file to do such thing?
This issue is very important to me, since if I can’t stop JAXB from
recreating element types and base types I will have to switch back to castor
that deals with this problem.

Thanks,
-- 
View this message in context: http://www.nabble.com/Can-Castor-do-things-that-JAXB-can%27t--tp18096928p18096928.html
Sent from the java.net - jaxb dev mailing list archive at Nabble.com.