Skip to main content

The things I would like to see in JAXB 2.0

1 reply [Last post]
Joined: 2004-11-17
Points: 0

Here is a preliminary list of things i'd like to see in JAXB 2.0:

1. All jar files should have different names from JAXB 1.0 files. This will allow using old code alongside the new (during the transition phase).
2. A GUI for jaxb-xjc. Shouldn't be too hard, and may then be integrated into NetBeans as JFluid did. May be provide plugins for Eclipse and IntelliJ to draw even more people.
3. Provide an Ant task. Integrating this one in the Ant script will not cause multi-step build of the projects.
4. Add a boolean flag that, when set to TRUE, will produce the same output as Marshaller.JAXB_SCHEMA_LOCATION. The information on schema location can be put with some special tag into ObjectFactory (or even added as a getter method there).
5. Allow marshaling to StringBuffer and unmarshaling from CharSequence. I am really tired of wrapping these with streams, readers and writers.
6. May be adopt XMLBeans interface of adding attributes instead of createing them. This way, you will prevent accidental sharing of objects throughout the hierarchy, and even the infinite circular dependencies.

That's it for now, but more will surely come from me and the community (hopefully).


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-09
Points: 0

Thanks for the comments. I think it might be worth while to have separate threads for each bullet point in the future.

you can override JAXB 1.0's jaxb-impl.jar with JAXB 2.0's jaxb-impl.jar and jaxb1-impl.jar, and you can have old code along side the new one. (Or maybe alternatively should we name it jaxb2-impl.jar and jaxb-impl?)

Do you still feel that we should be renaming jars?

This seems to be excellent side projects on If someone else is willing to do that, I'm very happy to provide more technical information to invoke XJC programatically.

There already is. See
You can use it in the same way as in 1.0.4.

The unit of compilation and the input to JAXBContext are not necessarily the same, so in general case this notion does not make sense.

Generating a constant on ObjectFactory seems to be more doable, but how does XJC know where the schema file is at the runtime?

We added marshal/unmarshal that read/write from Reader/Writer. Supporting StringBuffer seems to be interesting, but doing that for CharSequence seems bit dangerous because when you pass in String, it means a system ID, not a string that looks like XML.

Could you elaborate on this?