users@jaxb.java.net

inner class madness

From: Eliot Stock <E.Stock_at_syzygy.net>
Date: Thu, 20 May 2004 10:07:56 +0100

Hello.

I have some XSD schema with quite deep nesting of elements, on which jaxb
which is generating source with mad levels of inner class nesting. The
result is that the file names of the would-be class files are too long for
javac to handle:

    [javac] Compiling 414 source files to E:\airmiles\w\dev-build\asm\common
    [javac]
E:\airmiles\w\dev-build\src\uk\co\airmiles\web\integration\supplier\ypsilon\
generated\impl\AvailResponseTypeImpl.java:4592: error while writing
uk.co.airmiles
.web.integration.supplier.ypsilon.generated.impl.AvailResponseTypeImpl.Tarif
sTypeImpl.TarifTypeImpl.FareXRefsTypeImpl.FareXRefTypeImpl.FlightsTypeImpl.F
lightTypeImpl.LegX
RefsTypeImpl.LegXRefTypeImpl.Unmarshaller:
E:\airmiles\w\dev-build\asm\common\uk\co\airmiles\web\integration\supplier\y
psilon\generated\impl\AvailResponseTypeImpl$TarifsT
ypeImpl$TarifTypeImpl$FareXRefsTypeImpl$FareXRefTypeImpl$FlightsTypeImpl$Fli
ghtTypeImpl$LegXRefsTypeImpl$LegXRefTypeImpl$Unmarshaller.class (Filename
too long)
    [javac] public class Unmarshaller
    [javac] ^
    [javac] 1 error

I can shorten the absolute file path a bit by renaming directories and even
choosing a shorter package name for the generated sources, but that will
only get me so far. Is there any way to tell jaxb to flatten the class
hierarchy? I can find any customised binding instruction in the JAXB docs to
do so.

Cheers,

Eliot Stock
syzygy.net
+44 20 7598 9910