BeanInfo interface
to create a BeanInfo class
and provide explicit information about the methods,
properties, events, and other features of your beans.
When developing your bean, you can implement
the bean features required for your application task
omitting the rest of the BeanInfo features.
They will be obtained through the automatic analysis
by using the low-level reflection of the bean methods
and applying standard design patterns.
You have an opportunity to provide additional bean information
through various descriptor classes.
See the SimpleBeanInfo class that is
a convenient basic class for BeanInfo classes.
You can override the methods and properties of
the SimpleBeanInfo class to define specific information.
See also the Introspector class to learn more about bean behavior.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ICON_COLOR_16x16
Constant to indicate a 16 x 16 color icon. |
| public static final int | ICON_COLOR_32x32
Constant to indicate a 32 x 32 color icon. |
| public static final int | ICON_MONO_16x16
Constant to indicate a 16 x 16 monochrome icon. |
| public static final int | ICON_MONO_32x32
Constant to indicate a 32 x 32 monochrome icon. |
| Modifier and Type | Method and Description |
|---|---|
| public BeanInfo[] | Returns: an array ofBeanInfo objects,
or null if there are no additional BeanInfo objectsThis method enables the current |
| public BeanDescriptor | Returns: aBeanDescriptor object,
or null if the information is to
be obtained through the automatic analysisReturns the bean descriptor that provides overall information about the bean, such as its display name or its customizer. |
| public int | Returns: index of the default event in theEventSetDescriptor array
returned by the getEventSetDescriptors method,
or -1 if there is no default eventA bean may have a default event typically applied when this bean is used. |
| public int | Returns: index of the default property in thePropertyDescriptor array
returned by the getPropertyDescriptors method,
or -1 if there is no default propertyA bean may have a default property commonly updated when this bean is customized. |
| public EventSetDescriptor[] | Returns: an array ofEventSetDescriptor objects,
or null if the information is to
be obtained through the automatic analysisReturns the event descriptors of the bean that define the types of events fired by this bean. |
| public Image | Returns: an image object representing the requested icon, ornull if no suitable icon is availablethe kind of icon requested iconKind)Returns an image that can be used to represent the bean in toolboxes or toolbars. |
| public MethodDescriptor[] | Returns: an array ofMethodDescriptor objects,
or null if the information is to
be obtained through the automatic analysisReturns the method descriptors of the bean that define the externally visible methods supported by this bean. |
| public PropertyDescriptor[] | Returns: an array ofPropertyDescriptor objects,
or null if the information is to
be obtained through the automatic analysisReturns descriptors for all properties of the bean. |
| ICON_COLOR_16x16 | back to summary |
|---|---|
| public static final int ICON_COLOR_16x16 Constant to indicate a 16 x 16 color icon. | |
| ICON_COLOR_32x32 | back to summary |
|---|---|
| public static final int ICON_COLOR_32x32 Constant to indicate a 32 x 32 color icon. | |
| ICON_MONO_16x16 | back to summary |
|---|---|
| public static final int ICON_MONO_16x16 Constant to indicate a 16 x 16 monochrome icon. | |
| ICON_MONO_32x32 | back to summary |
|---|---|
| public static final int ICON_MONO_32x32 Constant to indicate a 32 x 32 monochrome icon. | |
| getAdditionalBeanInfo | back to summary |
|---|---|
| public BeanInfo[] getAdditionalBeanInfo() This method enables the current
If there are conflicts or overlaps between the information
provided by different
| |
| getBeanDescriptor | back to summary |
|---|---|
| public BeanDescriptor getBeanDescriptor() Returns the bean descriptor that provides overall information about the bean, such as its display name or its customizer.
| |
| getDefaultEventIndex | back to summary |
|---|---|
| public int getDefaultEventIndex() A bean may have a default event typically applied when this bean is used.
| |
| getDefaultPropertyIndex | back to summary |
|---|---|
| public int getDefaultPropertyIndex() A bean may have a default property commonly updated when this bean is customized.
| |
| getEventSetDescriptors | back to summary |
|---|---|
| public EventSetDescriptor[] getEventSetDescriptors() Returns the event descriptors of the bean that define the types of events fired by this bean.
| |
| getIcon | back to summary |
|---|---|
| public Image getIcon(int iconKind) Returns an image that can be used to represent the bean in toolboxes or toolbars. There are four possible types of icons: 16 x 16 color, 32 x 32 color, 16 x 16 mono, and 32 x 32 mono. If you implement a bean so that it supports a single icon, it is recommended to use 16 x 16 color. Another recommendation is to set a transparent background for the icons.
| |
| getMethodDescriptors | back to summary |
|---|---|
| public MethodDescriptor[] getMethodDescriptors() Returns the method descriptors of the bean that define the externally visible methods supported by this bean.
| |
| getPropertyDescriptors | back to summary |
|---|---|
| public PropertyDescriptor[] getPropertyDescriptors() Returns descriptors for all properties of the bean.
If a property is indexed, then its entry in the result array
belongs to the
| |