users@jaxb.java.net

Re: Injecting Code with Plugins

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 17 Mar 2006 18:03:35 -0800

dustin hunter wrote:
> I've got a jaxb plugin setup, now I am attempting to write a plugin that
> extracts the interface from JAX-B objects. I can create an interface
> JDefinedClass object well enough, but I'm having a harder time getting the
> interface hooked back into the Outline so that it will eventually be
> generated. All the examples I've found are not creating new objects, but
> modifying old ones. Can anyone point me in the right direction?

Can you explain bit more about what you are trying to do? What code you
are trying to generate, etc.

> In another thread someone mentioned that they were using Kosuke's
> CodeInjector class as a reference. Can anyone point me to this?

It's here, but the way it does it is ugly and I don't recommend it
unless you are desperate:

http://fisheye5.cenqua.com/viewrep/jaxb2-sources/jaxb-ri/xjc/src/com/sun/tools/xjc/addon/code_injector/PluginImpl.java?r=1.3

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com