users@jersey.java.net

How to use Jersey with an extended JAXB-class?

From: Marc Johnen <sun_at_johnen.biz>
Date: Thu, 15 Oct 2009 14:00:31 +0200 (CEST)

Hello everyone,

I wrote an extended class of a JAXB generated class.
When using JAXB, I would tell it to use a different ObjectFactory like this:

Unmarshaller u = context.createUnmarshaller();
u.setProperty("com.sun.xml.bind.ObjectFactory",new ObjectFactoryEx());
PersonEx p = (PersonEx)u.unmarshal(new StringReader("<person />"));
(see https://jaxb.dev.java.net/guide/Adding_behaviors.html)

Can I do something similar with Jersey? I can't find how.

Thanks
Marc