tags:

views:

202

answers:

1

Can I get JAXB 2.0 XJC compiler to generate a generic class for me?

Something as simple as:-

public class Shape<T> {
    T myShape;
    // getter / setter
}

I see references for this in the spec but am not sure I'm reading it right. I always get Object references.

A: 

I don't think so, no. However, it is quite easy to write an XJC plugin to get fine control over what code is generated.

skaffman