Annotation Type PropertyDesc


  • @Target(METHOD)
    @Retention(RUNTIME)
    public @interface PropertyDesc
    This annotation can be used to specify additional information for constructing a PropertyDescriptor.

    JFormDesigner first uses Introspector.getBeanInfo(Class) to construct PropertyDescriptors and then applies changes specified in annotations to copies of the PropertyDescriptors.

    This annotation may be used in a BeanInfo annotation (see BeanInfo.properties()) or may be attached to property getter or setter methods. If the getter method of a property is annotated, then the setter method of the same property is not checked for this annotation.

    Important: This annotation requires that the BeanInfo annotation is specified for the bean class. Otherwise this annotation is ignored when specified at methods.

    Example for attaching this annotation to a property getter method:

     @PropertyDesc(displayName="magnitude (in %)", preferred=true)
     public int getMagnitude() {
         return magnitude;
     }
     
    Example for specifying this annotation in a BeanInfo annotation:
     @BeanInfo(
         properties={
             @PropertyDesc(name="magnitude", displayName="magnitude (in %)", preferred=true)
         }
     )
     public class MyBean extends JCompoment { ... }