Skip to main content

The things I would like to see in JAXB 2.0

1 reply [Last post]
kirillcool
Offline
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).

Kirill
http://weblogs.java.net/blog/kirillcool

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kohsuke
Offline
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.

(1)
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?

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

(3)
There already is. See http://java.sun.com/webservices/docs/1.5/jaxb/ant.html
You can use it in the same way as in 1.0.4.

(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?

(5)
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.

(6)
Could you elaborate on this?