| Author |
Get the list of packages, classes in packages and methods in class
|
Serkan Demir
Ranch Hand
Joined: Feb 03, 2005
Posts: 61
|
|
Hi everybody, I am working on a code generation project with Velocity. In order to use as parameters, I have to get the list of packages, classes in packages and methods in classes and put them into different array lists. Is there any built-in libraries or java methods for these operation? thanks lot, Serkan
|
A guy from Turkey<br /><a href="http://blogspot.serkandemir.com" target="_blank" rel="nofollow">http://blogspot.serkandemir.com</a>
|
 |
Satish SN
Ranch Hand
Joined: Apr 19, 2005
Posts: 70
|
|
|
U can get the Information from java.lang.Class
|
Satish SN<br />SCJP 1.4 & SCWCD 1.4
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24059
|
|
java.lang.Class can, indeed, tell you the methods in a class; but the only way to get a list of packages or a list of classes in a package is by examining the class path and searching for .class files both in and out of JAR files along that class path. This is a bit easier if you can limit the scope of your query to the classes loaded by a custom classloader that you created yourself, so you know exactly where it's searching. This is not even close to a "Beginner" topic, so I'm going to move this to Java in General (Intermediate).
|
[Jess in Action][AskingGoodQuestions]
|
 |
 |
|
|
subject: Get the list of packages, classes in packages and methods in class
|
|
|