-
how to load classes for a particular package
I have a package name say com.test
i need to get the names of all the classes starting with "Test" under this package. Also, i need to get the names of all the methods starting with "test" in each of these classes.
ideas/suggestions welcome 
cheers
yogesh
-
I imagine you mean you want to do this programatically, yes? Well the easiest way to do this would be to use Reflection. Take a look at http://java.sun.com/developer/techni...LT/Reflection/ . This lets you look at internal properties of classes, such as the names of all the methods declared.
I'm not sure if you can use reflection to list all the classes in a paticular package, but if you can't then you can simply look in the relevant directory, find the names of all the files that end .class, and then look for ones with the right name. When you have found them you can use reflection to discover their methods.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks