Could a variation on Class.forName be used - like with jdbc driver loading - to then allow normal instance creation with "new". If the file has to be in the classpath, could you "dump" the class and then use Class.forName?
Mark -----Original Message----- From: Mark R. Diggory [mailto:[EMAIL PROTECTED] Sent: 01 April 2003 15:34 To: Mark Proctor (mproctor); [EMAIL PROTECTED] Subject: Re: Generating method Code for setters Mark Proctor (mproctor) wrote: > Mark, > > I'm having to read up on classloaders and security - as it still doesn't > mean much to me :( - I don't understand why you have to do > myclass.newInstance - how can I get it to operate like a normal class so > I can just do MyClass myclass = new MyClass(). > I think that may be tough to do because using "new" really requires that class to be present at "compile time", while the BCEL based class you've generated is only available during the "runtime" of JVM instance your created it in. Thats why you need to use newInstance at that point. Now, if your creating the BCEL class and then saving it to a class file for future use in another "JVM" instance, I think you can use it with "new" because it really is just like any other class. I could be incorrect on this, I will cross post tot he list to get some critique. -MRD > Do you use IRC or ICQ? > Nope, sorry, I pretty much stick to email. --------------------------------------------------------------------- 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]
