Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > get package classes

Reply
Thread Tools

get package classes

 
 
Chameleon
Guest
Posts: n/a
 
      04-27-2005
Can I have an enumeration/vector/array or something with all classes
of a package?

I have a class script.Compile and I want this class enumerate all
classes inside package script.functions

I try class "Package" but I cannot found a method like "getClasses()" or
"getClassesNames()"
 
Reply With Quote
 
 
 
 
Tor Iver Wilhelmsen
Guest
Posts: n/a
 
      04-27-2005
Chameleon <(E-Mail Removed)> writes:

> Can I have an enumeration/vector/array or something with all classes
> of a package?


No: Packages do not exist as "objects", since a class in a package can
be anywhere on the classpath. The VM only knows about the classes that
have been loaded.

You can roll your own scanner of the classpath of course.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
has a way to get all classes in a package? aeonsun Java 4 07-26-2006 11:12 PM
Get classes from package Tomasso Java 9 05-25-2006 04:15 PM
Debate: Inner classes or public classes with package access? Christian Bongiorno Java 5 08-30-2004 08:14 AM
get classes from package Stefan Haun Java 1 07-30-2004 09:42 PM
Can I using reflection to get all child classes or classes undera package dynamically? Carfield Yim Java 1 05-31-2004 05:33 PM



Advertisments