users@jaxb.java.net

Re: Generating java objects from xml with no pre-compiling or external tools.

From: Les Hazlewood <les_at_hazlewood.com>
Date: Fri, 16 May 2003 14:46:57 +0100

This is easily achived with a java class just internally executing the xjc
compiler in a seperate thread with the XML file as input.

This way, the xml is converted to Java classes and those classes are
compiled "on the fly" during runtime.

You just need to specify where the classes are generated and where the
compiled classes go...then you'd have to ensure that your current
ClassLoader is aware of the new classes. (Class.forName() maybe?)

The other way is to directly use Runtime.exec(...), but this doesn't
guarantee platform independence like the first approach does.

Les