dev@jaxb.java.net

custom accessors, was Re: CVS branch?

From: Levi Purvis <javanet_at_purvis.ws>
Date: Thu, 16 Nov 2006 15:34:19 -0500

> Head is 2.0.x and the jaxb-2_1-branch is for the 2.1 code.

Thanks.

> Cool. Let me think about the runtime hook, too. Now that the release is
> done, we can do some experiments.

I was initially thinking of maybe an AccessorFactory interface, where
an implementation could be specified by a package-level annotation.
Something like:

@XmlAccessorFactory(com.foo.AccessorFactoryImpl)

interface AccessorFactory {

  Accessor forFieldAccess(Class type, Field f, boolean readOnly);

  Accessor forPropertyAccess(Class type, Method getter, Method setter);
}

With something like this, if the default RI factory could be made
public, then it could be easily extended to add a "wrapper" accessor
on top of the default behavior (decorator pattern). But it would also
allow a complete override if someone wanted to get creative with
bytecode manipulation for performance or whatever.

Thoughts?