Re: New Reflection/Beans API
Markus Dahm <[email protected]>
| Newsgroups | gmane.comp.jakarta.bcel.devel |
|---|---|
| Message-ID | <[email protected]> |
[email protected] wrote: > I don't see what you are talking about. You know what class you are > calling the static method on, it's just a matter of casting the return > value of the method. Where does the dispatcher come in? Ok, you have added a static method foo() to the "to be reflected class" A, what you would write in plain source code then is A.foo() And that's the crucial point, because we're not on source code level here, i.e., there's no place where this code is present. The method exists, but you can not call it (without using "normal" reflection). With instance methods it works, because have have an instance, i.e., an object which can cast to something appropriate. as shown in the example. With static methods you don't have an instance, thus no cast possible. You need to generate an additional object on the fly that calls that method, and that's what I'm talking about. Cheers Markus