BeanProperty (Java SE 14 & JDK 14)
Description: declaration: module: java.desktop, package: java.beans, annotation type: BeanProperty
Keywords: java.beans.BeanProperty class

Module java.desktop
Package java.beans

# Annotation Type BeanProperty

    @Documented
    @Target(METHOD)
    @Retention(RUNTIME)
    public @interface BeanProperty

An annotation used to specify some property-related information for the automatically generated `BeanInfo` classes. This annotation is not used if the annotated class has a corresponding user-defined `BeanInfo` class, which does not imply the automatic analysis. If both the read and the write methods of the property are annotated, then the read method annotation will have more priority and replace the write method annotation.

Since:
  9
See Also:
  `BeanInfo.getPropertyDescriptors()`

- ## Optional Element Summary

  Optional Elements
  Modifier and Type | Optional Element | Description
  --- | --- | ---
  `boolean` | `bound` | The value that indicates whether the annotated property can be a `bound` property or not.
  `String` | `description` | The `short description` for the `descriptor` of the annotated property.
  `String[]` | `enumerationValues` | The array of names for the public static fields that contains the valid values of the annotated property.
  `boolean` | `expert` | The value that indicates whether the annotated property is an `expert` property or not.
  `boolean` | `hidden` | The value that indicates whether the annotated property is a `hidden` property or not.
  `boolean` | `preferred` | The value that indicates whether the annotated property is a `preferred` property or not.
  `boolean` | `required` | The value that indicates whether the annotated property is a required property or not.
  `boolean` | `visualUpdate` | The value that indicates whether the corresponding component is repainted after the annotated property got changed or not.

- ## Element Details

  - ### bound

    boolean bound
    The value that indicates whether the annotated property can be a `bound` property or not. This value applies only to the beans that have the `propertyChange` event set.
    Returns:
      `true` if the annotated property can be a bound property; `false` otherwise.
    Default:
      true

  - ### expert

    boolean expert
    The value that indicates whether the annotated property is an `expert` property or not.
    Returns:
      `true` if the annotated property is an expert property; `false` otherwise.
    Default:
      false

  - ### hidden

    boolean hidden
    The value that indicates whether the annotated property is a `hidden` property or not.
    Returns:
      `true` if the annotated property is a hidden property; `false` otherwise.
    Default:
      false

  - ### preferred

    boolean preferred
    The value that indicates whether the annotated property is a `preferred` property or not.
    Returns:
      `true` if the annotated property is a preferred property; `false` otherwise.
    Default:
      false

  - ### required

    boolean required
    The value that indicates whether the annotated property is a required property or not.
    Returns:
      `true` if the annotated property is a required property; `false` otherwise.
    Default:
      false

  - ### visualUpdate

    boolean visualUpdate
    The value that indicates whether the corresponding component is repainted after the annotated property got changed or not.
    Returns:
      `true` if the corresponding component is repainted; `false` otherwise.
    Default:
      false

  - ### description

    String description
    The `short description` for the `descriptor` of the annotated property.
    Returns:
      the property description, or an empty string if the description is not set.
    Default:
      ""

  - ### enumerationValues

    String[] enumerationValues
    The array of names for the public static fields that contains the valid values of the annotated property. These names are used to generate the `enumerationValues` `feature attribute` that must contain the following items per each property value: a displayable name for the property value, the actual property value, and a Java code piece used for the code generator.
    Returns:
      the names of the valid values of the annotated property, or an empty array if the names are not provided.
    Default:
      {}