Article View: borland.public.jbuilder.java.language
Article #17623How to use Class.getDeclaredClasses()
From: Dillan Fernando
Date: Sat, 10 Oct 1998 00:00
Date: Sat, 10 Oct 1998 00:00
30 lines
1019 bytes
1019 bytes
Hello,
I want to write a bean which reads the components in the class which it was
dropped in. I tried the following;
public class myBean{
private Object parent;
...
...
...
public void setParent(Object p)
{ parent = p;
Class cls = p.getClass();
Class clsArray[] = cla.getDeclaredClasses();
for(int a=0;a<clsArray.length;a++)
this.list1.add(clsArray[a].getName();
}
..
..
}
The problem is the array (clsArray) length is always 0. Any Ideas ?
Thanks in advance
Dillan Fernando
Senior Analyst
Palmware (Pvt) Ltd.
Sri Lanka
Technical Details
Message-ID:
<6vlpin$2jm6@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,5bf830c66503d4c8,start X-Google-Attributes: gidf74b3,public From: "Dillan Fernando" <dillan@geocities.com> Subject: How to use Class.getDeclaredClasses() Date: 1998/10/10 Message-ID: <6vlpin$2jm6@forums.borland.com> X-Deja-AN: 399460179 Organization: Palmware X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Newsgroups: borland.public.jbuilder.java.language