users@jaxb.java.net

Re: Injecting Code with Plugins

From: dustin hunter <cosmicnonplusation+coding_at_gmail.com>
Date: Sat, 18 Mar 2006 09:02:45 -0800

Basically what I want to do is extract an interface for each and every java
element created by JAXB, and have the implementation implement the
interface.

The problem I am having is that we have many different versions of a 3rd
party schema that we need to work with. They are almost the same, but
slightly different. I want to be able to write our code such that it does
not care about the discrepencies between the schemas, and so that it only
ever works with interfaces and factories.

On 3/17/06, Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_sun.com> wrote:
>
> 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
>
>
>


--
Cosmicnonplusation - The feeling of being infinitely small in an infinitely
large universe.