Re: KVC and static methods (was Hairy Java related question)
Re: KVC and static methods (was Hairy Java related question)
- Subject: Re: KVC and static methods (was Hairy Java related question)
- From: Ben Trumbull <email@hidden>
- Date: Sun, 26 Oct 2003 13:51:34 -0800
At 21:45 +0100 10/26/03, petite_abeille wrote:
I think he is referring to something like 'instanceof' which
requires an object instance.
You can do an operation equivalent to instanceof without an object
instance. java.lang.Class.isAssignableFrom()
The reflection API is really quite easy to use. The only difficulty
is the difference between java.lang.Class.getX() and getDeclaredX().
getX only returns public members. getDeclaredX returns any kind.
Unfortunately, it's not that simple. getX returns inherited members,
but getDeclaredX does not. So if you want to find all the protected
methods on a Class, you need to loop through getDeclaredMethods all
the way up the inheritance hierarchy.
--
-Ben
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.