This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] java.beans.EventHandler


Bryce McKinlay writes:
 > Hmm. It seems to me that you can infer propertyType by looking up the 
 > method for eventPropertyName and checking its return type? The return 
 > type for the event property must be compatible with the argument for the 
 > action, after all.

Yes, but you don't yet know the class to look up eventPropertyName in when
constructing the EventHandler.  Especially when directly calling the
constructor.  Even when using the create methods, let's say you create without
providing listenerMethodName.  This means that all listener methods are
handled by using the first argument as the event.  Each one could potentially
be passed a different object type.  Which do you use to acquire the Method
object?

 > Even though the chain can be heirarchical, the objects in the chain at 
 > runtime must still be type compatible with the properties that were 
 > passed into the create() method, right?

Except that the properties are passed as Strings and not Classes or Methods.

I'd love to be wrong here, but I don't think I am.

Later,
Jerry


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]