dev@jaxb.java.net

Re: How to generate an abstract class with JAXB?

From: Pavel Bucek <Pavel.Bucek_at_Sun.COM>
Date: Tue, 25 Nov 2008 21:33:53 +0100

Hello,

if you can edit schema, try something like this:

    <xs:complexType name="abstrClass" abstract="true">
        <xs:sequence>
            <xs:element name="field1" type="xs:int" />
            <xs:element name="field2" type="xs:int" />
        </xs:sequence>
    </xs:complexType>

and

public abstract class AbstrClass { .. }

will be generated.


Pavel


alisamad wrote:
> Hi I have posted this question somewhere, so I am gonna try here as well.
>
> I have a schema file and I would like to generate a class which would be an
> abstract class
> i.e the generated class would look like this:
>
> public abstract class MyClass {
> .....
> }
>
> Can it be done with an annotation or with an external binding file?
>
> many thanks,
>
>