[patch] java.beans.EventHandler

Jerry Quinn jlquinn@optonline.net
Fri Jul 16 14:12:00 GMT 2004


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



More information about the Java-patches mailing list