On Tue, Feb 24, 2009 at 5:53 PM, Tonny Kohar <[email protected]> wrote:
> Hi,
>
> How do I check method return type  whether it is Property,
> Association, ManyAssociation ?
> Is there an API for this ? or I should use the plain reflection
> methods.getReturnType or method.getGenericReturnType ?

method.getReturnType() to check for Proeprty, Asssociation and
ManyAssociation. Other types, ignore the method altogether.

Once you know it is one of the 3, then you do
method.getGenericReturnType() to retrieve the "property type" which we
want displayed.

That said, I think your visitor is called for PropertyDescriptor in
which case you have the "property type" in the type() method. Same for
Association, and it seems that there is no ManyAssociationDescriptor
yet. Need to add that.


Cheers
Niclas
-- 
http://www.qi4j.org - New Energy for Java

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to