Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Class Object From .class File



On Thursday, May 31, 2001, at 03:48 PM, James Gray wrote:

I've run into a little problem and could use a little help. My program needs to dynamically load a few classes from files in a certain directory. I know how to get and parse a list of those files and I also know how how to verify and create instances from a Class object. The knowledge I'm missing is the middle part. How do I go get the VM to load a Class object from a File object? Thanks very much for your help

You need to read the files from a class loader, then defineClass() on the byte [] and resolveClass() on that
JavaWorld had a pretty example of a file source ClassLoader.
You're welcome to look at what I've done to that, my utillib package, utillib.psuedoGestalt.context.RunerContext.
Not sure if it's gotten any better but more elaborate by now then the JavaWorld example.

Mike Hall <email@hidden>
<http://www.spacestar.net/users/mikehall>


References: 
 >Class Object From .class File (From: James Gray <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.