java.beans

Class SimpleBeanInfo

public class SimpleBeanInfo extends Object implements BeanInfo

SimpleBeanInfo is a class you may extend to more easily provide select information to the Introspector. It implements all of the methods in BeanInfo by returning null and forces the Introspector to behave exactly as if there were no BeanInfo class at all (Introspecting everything).

Overriding one or two of these functions to give explicit information on only those things you wish to give explicit information is perfectly safe, and even desirable.

See the BeanInfo class for information on what the various methods actually do.

Since: JDK1.1

See Also:

Method Summary
BeanInfo[]getAdditionalBeanInfo()
Tell the Introspector to go look for other BeanInfo itself.
BeanDescriptorgetBeanDescriptor()
Force Introspection of the general bean info.
intgetDefaultEventIndex()
Say that there is no "default" event set.
intgetDefaultPropertyIndex()
Say that there is no "default" property.
EventSetDescriptor[]getEventSetDescriptors()
Force Introspection of the events this Bean type fires.
ImagegetIcon(int iconType)
Say that this Bean has no icons.
MethodDescriptor[]getMethodDescriptors()
Force Introspection of the Bean's methods.
PropertyDescriptor[]getPropertyDescriptors()
Force Introspection of the Bean properties.
ImageloadImage(String location)
Helper method to load an image using the Bean class getResource() method on the BeanInfo class (using getClass(), since you'll extend this class to get the BeanInfo).

Method Detail

getAdditionalBeanInfo

public BeanInfo[] getAdditionalBeanInfo()
Tell the Introspector to go look for other BeanInfo itself.

Returns: null.

getBeanDescriptor

public BeanDescriptor getBeanDescriptor()
Force Introspection of the general bean info.

Returns: null.

getDefaultEventIndex

public int getDefaultEventIndex()
Say that there is no "default" event set.

Returns: -1.

getDefaultPropertyIndex

public int getDefaultPropertyIndex()
Say that there is no "default" property.

Returns: -1.

getEventSetDescriptors

public EventSetDescriptor[] getEventSetDescriptors()
Force Introspection of the events this Bean type fires.

Returns: null

getIcon

public Image getIcon(int iconType)
Say that this Bean has no icons.

Parameters: iconType the type of icon

Returns: null.

getMethodDescriptors

public MethodDescriptor[] getMethodDescriptors()
Force Introspection of the Bean's methods.

Returns: null.

getPropertyDescriptors

public PropertyDescriptor[] getPropertyDescriptors()
Force Introspection of the Bean properties.

Returns: null.

loadImage

public Image loadImage(String location)
Helper method to load an image using the Bean class getResource() method on the BeanInfo class (using getClass(), since you'll extend this class to get the BeanInfo). Basically it's assumed that the Bean and its BeanInfo are both loaded by the same ClassLoader, generally a reasonable assumption.

Parameters: location the URL relative

Returns: the Image in question (possibly null).