users@jaxb.java.net

Addition Behaviour - How portable is it?

From: Stefan Baramov <stefan_bar_at_bellsouth.net>
Date: Wed, 08 Aug 2007 09:57:22 -0400

Question: How portable is the approach to add behavior described in
http://jaxb.dev.java.net/guide/Adding_behaviors.html?

I am asking because the suggested way to provide a custom object factory
is using a undocumented property: com.sun.xml.bind.ObjectFactory. I know
for sure this is broken in Java6. So I am curious will their be some
official way doing this or should i stick with logic like this:

if java 6 then
   u.setProperty("com.sun.xml.*internal.*bind.ObjectFactory", new
MyFactory())
else
  u.setProperty("com.sun.xml.bind.ObjectFactory", new MyFactory())


Thanks
Stefan