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

RFE: PropertyDescriptor should support getGenericPropertyType() method

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P5
    • Resolution: Unresolved
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_2003

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Imported:
                Indexed: