users@jaxb.java.net

Help with the code-injector plugin, or code injection in general

From: dan twining <dantwining_at_gmail.com>
Date: Fri, 13 May 2011 10:28:56 +0100

(Apologies if this is a re-posting - I had a second confirmation that I'd
joined the mailing list after I'd sent this, and my original isn't appearing
on the Nabble archives even though later postings do)

Hello jaxb users,

I'm struggling to find out information about the code-injector plugin (
http://jaxb.dev.java.net/plugin/code-injector), and was wondering if anyone
could help. I'm using it to add behaviour to my jaxb-generated classes, and
would like to know if/how I can inject imports as part of what's added.

A bit of background: we use XML to define our shared data objects, and then
and XJB and jaxb to generate objects from that XML. In the past, we've then
mapped those value objects, using Dozer, to "proper" objects that have both
state and behaviour.

What I'm trying to do is skip the Dozer step, and have jaxb generate proper
objects in the first place. The code-injector plugin seems like a really
good way to do this, but I don't know if I can add imports as part of the
process. I guess I could use fully-qualified class names, but that doesn't
seem quite right.

Any help you can give would be most appreciated.

Thanks,
Dan