We use this in cglib without problems on sun jdk implementations, reflection is used to invoke protected method, but it is possible to extend ClassLoader and call this method "normal" way if you do not need to cast generated classes or accsess superclass loaded by different classloaders.
> On Fri, 21 Mar 2003 16:51:40 -0500, Berin Loritsch wrote: > > > I want to generate a class--and not output a class file. > > I want to use the class object directly. Any hints? > > I haven't tried this myself, but I believe that you use the defineClass method of your favourite ClassLoader. You can get the byte[] required by the defineClass method from the JavaClass.getBytes method. > > __ > __ / /\ > / /\/ / /_ ------------------------------------ > / / \/ / /\ Mark Crocker > / / /\ \ \/ / [EMAIL PROTECTED] > / / \_\/\ / http://www.markcrocker.com/~mcrocker > /__/ /\ \ \_\/ ------------------------------------ > \ \ \_\/ > \ \ \ > \__\/ > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
