Class SimpleBeanInfo
java.lang.Object
java.beans.SimpleBeanInfo
- All Implemented Interfaces:
BeanInfo
This is a support class to make it easier for people to provide
BeanInfo classes.
It defaults to providing "noop" information, and can be selectively overridden to provide more explicit information on chosen topics. When the introspector sees the "noop" values, it will apply low level introspection and design patterns to automatically analyze the target bean.
- Since:
- 1.1
-
Field Summary
Fields declared in interface BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32Modifier and TypeFieldDescriptionstatic final intConstant to indicate a 16 x 16 color icon.static final intConstant to indicate a 32 x 32 color icon.static final intConstant to indicate a 16 x 16 monochrome icon.static final intConstant to indicate a 32 x 32 monochrome icon. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBeanInfo[]Claim there are no other relevant BeanInfo objects.Deny knowledge about the class and customizer of the bean.intDeny knowledge of a default event.intDeny knowledge of a default property.Deny knowledge of event sets.getIcon(int iconKind) Claim there are no icons available.Deny knowledge of methods.Deny knowledge of properties.This is a utility method to help in loading icon images.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Constructor Details
-
SimpleBeanInfo
public SimpleBeanInfo()Constructs aSimpleBeanInfo.
-
-
Method Details
-
getBeanDescriptor
Deny knowledge about the class and customizer of the bean. You can override this if you wish to provide explicit info.- Specified by:
getBeanDescriptorin interfaceBeanInfo- Returns:
- a
BeanDescriptorobject, ornullif the information is to be obtained through the automatic analysis
-
getPropertyDescriptors
Deny knowledge of properties. You can override this if you wish to provide explicit property info.- Specified by:
getPropertyDescriptorsin interfaceBeanInfo- Returns:
- an array of
PropertyDescriptorobjects, ornullif the information is to be obtained through the automatic analysis
-
getDefaultPropertyIndex
public int getDefaultPropertyIndex()Deny knowledge of a default property. You can override this if you wish to define a default property for the bean.- Specified by:
getDefaultPropertyIndexin interfaceBeanInfo- Returns:
- index of the default property in the
PropertyDescriptorarray returned by thegetPropertyDescriptorsmethod, or -1 if there is no default property
-
getEventSetDescriptors
Deny knowledge of event sets. You can override this if you wish to provide explicit event set info.- Specified by:
getEventSetDescriptorsin interfaceBeanInfo- Returns:
- an array of
EventSetDescriptorobjects, ornullif the information is to be obtained through the automatic analysis
-
getDefaultEventIndex
public int getDefaultEventIndex()Deny knowledge of a default event. You can override this if you wish to define a default event for the bean.- Specified by:
getDefaultEventIndexin interfaceBeanInfo- Returns:
- index of the default event in the
EventSetDescriptorarray returned by thegetEventSetDescriptorsmethod, or -1 if there is no default event
-
getMethodDescriptors
Deny knowledge of methods. You can override this if you wish to provide explicit method info.- Specified by:
getMethodDescriptorsin interfaceBeanInfo- Returns:
- an array of
MethodDescriptorobjects, ornullif the information is to be obtained through the automatic analysis
-
getAdditionalBeanInfo
Claim there are no other relevant BeanInfo objects. You may override this if you want to (for example) return a BeanInfo for a base class.- Specified by:
getAdditionalBeanInfoin interfaceBeanInfo- Returns:
- an array of
BeanInfoobjects, ornullif there are no additionalBeanInfoobjects
-
getIcon
Claim there are no icons available. You can override this if you want to provide icons for your bean. -
loadImage
This is a utility method to help in loading icon images. It takes the name of a resource file associated with the current object's class file and loads an image object from that file. Typically images will be GIFs.- Parameters:
resourceName- A pathname relative to the directory holding the class file of the current class. For example, "wombat.gif".- Returns:
- an image object or null if the resource is not found or the resource could not be loaded as an Image
-