users@jersey.java.net

JaxbContextResolver

From: Sven Waibel <sven.waibel_at_web.de>
Date: Thu, 20 May 2010 09:48:14 +0200

Hi,

i have several classes (A,B,C...), all have the same superclass (Base.class).

Is it possible to set the superclass into the context and not all of
my classes (A,B,C..)?

E.g.:

private JAXBContext context;
private Class<?>[] types = { Base.class };

public JaxbContextResolver() throws Exception {
     JSONConfiguration config = JSONConfiguration.natural().build();
     this.context = new JSONJAXBContext(config, this.types);
}
...

Thanks
Sven