dev@jaxb.java.net

Customizations in JAXB 1.x

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Sun, 12 Jun 2005 20:14:15 +0200

Hi.

I generally like the idea of CCustomizations in JAXB 2. I failed to make
them work in my plugins right now, but this is just a temporary problem.

I think that customizations are also very important for JAXB 1.x. The
first version will live as long as Java 1.4 will not be replaced with
5.0 in all of the systems - and that will be a very long time. This
means HyperJAXB 1 will go on as well.

Current solution of customization in HyperJAXB 1 is based on XDoclets
included into the jaxb:javadoc annotations. This works but is very far
from being something elegant, indeed.

Threfore I'd be glad if JAXB 1 also implements customization in a style
similar to Jaxb 2:

* CustomizableCodeAugmenter interface extends CodeAugmenter with
getCustomizationURIs() and isCustomizationTagName(); (optional)

* Customization instance holds a DOM Element with annotation;

* ClassItem and FieldItem are Customizable.

I've worked a bit today and added basic customization support to JAXB
1.x. I've extended binding.rng and patched a couple of classes to copy
binding declarations from annotations to FieldItem/ClassItem. This is
very basic support - external binding customizations are not processed,
no namespace-based filtering and so on, but this is already satisfactory.

I've attached the patched sources (the whole src directory).

Could we get this into the production release some day?

Is there a possibility for me to access jaxb 1.x sources in a CVS?

I've also filed an issue so that we could keep track of things.

Bye.
/lexi