users@jaxb.java.net

RE: globalBindings and org.w3 generated classes

From: Adrian Brogan <adrian.brogan_at_burnsecs.com>
Date: Thu, 30 Oct 2003 14:21:12 -0000

> Issue #2) JAXB generation is creating classes in a package called
> org.w3._2001.xmlschema (and org.w3._2001.xmlschema.impl). I have
tried to
> custom map this to my package names to no avail. Due to enterprise
coding
> standards I am required to have any classes I use be in my assigned
URI.
> Is there anyway to map the org.w3 classes to a different package?

I'm not sure what you have tried already, but I use the previous version
of JAXB, any have used (successfully) 3 different ways to customise the
package name.

1. Use the -p option on the xjc compiler to specify the destination
package for classes

2. Use the jaxb:package element in a schemaBinding element to specify
the destination package (either in the external binding file or within
the schema).

e.g.
<jxb:schemaBindings>
        <jxb:package name="com.foo.bar"/>
</jxb:schemaBindings>

3. If you define targetNamespaces in your schema, the destination
package will be built up from that.

Note: I'm not aware of any way to specify a different package for the
implementation and runtime classes. i.e. they always go in packages impl
and impl.runtime below the destination package.

Regards
Adrian Brogan


-----Original Message-----
From: Greg T Robertson [mailto:gregrob_at_us.ibm.com]
Sent: 30 October 2003 14:05
To: users_at_jaxb.dev.java.net
Subject: globalBindings and org.w3 generated classes





I have two separate issues in working with JAXB. I am using JAXB 1.0.2
from JWSDP 1.3.

Issue #1) If I add the following to my bindings file (used by XJC) it
appears to be ignored
<jaxb:globalBindings>
      <xjc:serializable />
      <jaxb:javaType name="java.util.Calendar"
            xmlType="oa:DateTimeAny"
 
parseMethod="financing.ifservices.util.XMLUtil.parseCalendar"
 
printMethod="financing.ifservices.util.XMLUtil.printCalendar"
/>
</jaxb:globalBindings>

but if I place the same in the first XSD file that the bindings file
points
to (of course using an annotation with appinfo), the classes are
generated
properly (e.g. implementing java.io.Serializable and using custom
methods
for any of the XML types that are of type DateTimeAny). Is there any
reason why this would not work from the bindings file?

Issue #2) JAXB generation is creating classes in a package called
org.w3._2001.xmlschema (and org.w3._2001.xmlschema.impl). I have tried
to
custom map this to my package names to no avail. Due to enterprise
coding
standards I am required to have any classes I use be in my assigned URI.
Is there anyway to map the org.w3 classes to a different package?

Thanks,

Greg T. Robertson


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net