Details

    • Author:
      Sergey Malenkov
    • JEP Type:
      Feature
    • Exposure:
      Open
    • Subcomponent:
    • Scope:
      JDK
    • Discussion:
      beans dash dev at openjdk dot java dot net
    • Effort:
      L
    • Duration:
      L
    • Alert Status:
       Green
    • Alert Reason:
      Completed
    • JEP Number:
      256

      Description

      Summary

      Replace @beaninfo Javadoc tags with proper annotations, and process those annotations at run time to generate BeanInfo classes dynamically.

      Motivation

      Simplify the creation of custom BeanInfo classes and enable the modularization of the client library.

      Description

      Most BeanInfo classes are automatically generated at runtime, but many Swing classes still generate BeanInfo classes from @beaninfo Javadoc tags at compile time. We propose to replace the @beaninfo tags with the following annotations, and extend the existing introspection algorithm to interpret them:

      package java.beans;
      public @interface JavaBean {
          String description() default "";
          String defaultProperty() default "";
          String defaultEventSet() default "";
      }
      
      package java.beans;
      public @interface BeanProperty {
          boolean bound() default true;
          boolean expert() default false;
          boolean hidden() default false;
          boolean preferred() default false;
          boolean visualUpdate() default false;
          String description() default "";
          String[] enumerationValues() default {};
      }
      
      package javax.swing;
      public @interface SwingContainer {
          boolean value() default true;
          String delegate() default "";
      }

      For further detail, see the Javadoc for JavaBean, BeanProperty, and SwingContainer.

      These annotations will set the corresponding feature attributes during BeanInfo generation at run time. It will be easier for developers to specify these attributes directly in Bean classes rather than create a separate BeanInfo class for every Bean class. It will also allow the removal of the automatically-generated classes, which will make it easier to modularize the client library.

      Testing

      We'll need to verify that the new introspection algorithm behaves as expected. We'll also need to verify that the new introspection algorithm doesn't break backward compatibility, or else ensure that cases in which compatibility is broken are rare.

      Risks and Assumptions

      • The new introspection algorithm may behave somewhat differently, but we do not expect any serious backward incompatibilities.

      • We do not expect any performance degradation. The refactoring of the introspection algorithm might improve performance.

        Issue Links

          Activity

          Hide
          vdyakov Victor Dyakov added a comment -
          NOTE: Dev Due Date is Apr 13.
          Show
          vdyakov Victor Dyakov added a comment - NOTE: Dev Due Date is Apr 13.
          Hide
          alioffe Alexander Ioffe (Inactive) added a comment -
          Testing due date is September 27
          Show
          alioffe Alexander Ioffe (Inactive) added a comment - Testing due date is September 27
          Hide
          vdyakov Victor Dyakov added a comment -
          The JEP is Targeted -- it means you have green light to push reviewed code to JDK 9 repo
          Show
          vdyakov Victor Dyakov added a comment - The JEP is Targeted -- it means you have green light to push reviewed code to JDK 9 repo
          Hide
          serb Sergey Bylokhov added a comment -
          The main part of the JEP (JDK-4763438) was pushed to the client ws:
          http://hg.openjdk.java.net/jdk9/client/jdk/rev/b89f353e2f9a
          Show
          serb Sergey Bylokhov added a comment - The main part of the JEP ( JDK-4763438 ) was pushed to the client ws: http://hg.openjdk.java.net/jdk9/client/jdk/rev/b89f353e2f9a

            People

            • Assignee:
              serb Sergey Bylokhov
              Reporter:
              malenkov Sergey Malenkov (Inactive)
              Owner:
              Sergey Bylokhov
              Reviewed By:
              Kevin Rushforth, Richard Bair
              Endorsed By:
              Kevin Rushforth
            • Votes:
              1 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:
                Integration Due: