Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6473468

RFE: PropertyDescriptor should support getGenericPropertyType() method

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P5 P5
    • None
    • 6
    • client-libs
    • x86
    • windows_2003

      A DESCRIPTION OF THE REQUEST :
      When the type of a property is a generic collection type (like List<String>), the existing PropertyDescriptor.getPropertyType() method returns only the "raw" property type of "List". What is needed is a method like this:

          Type getPropertyGenericType();

      that would return the full generic type (List<String>) as obtained from
        getReadMethod()..getGenericReturnType();
      or
        getWriteMethod().getGenericParameterTypes()[0];

      The other "Descriptor" types should probably have the same enhancement. Eg, "BeanDescriptor" should have a new method:
          Type getBeanGenericClass();
      and so on.


      JUSTIFICATION :
      When generics were introduced, the "java.lang.reflect.Field" class added a "getGenericType()" type to compliment the existing "getType()" method.
      This RFE would just be adding the same capability to the "PropertyDescriptor" class.



      CUSTOMER SUBMITTED WORKAROUND :
      The only work around is to access the same information through the "java.lang.reflect.*" classes, which defeats the purpose of having the java.beans package in the first place.

            malenkov Sergey Malenkov (Inactive)
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: