Class java.beans.Introspector
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.beans.Introspector

java.lang.Object
   |
   +----java.beans.Introspector

public class Introspector
extends Object
The Introspector class provides a standard way for tools to learn about the properties, events, and methods supported by a target Java Bean.

For each of those three kinds of information, the Introspector will separately analyze the bean's class and superclasses looking for either explicit or implicit information and use that information to build a BeanInfo object that comprehensively describes the target bean.

For each class "Foo", explicit information may be available if there exists a corresponding "FooBeanInfo" class that provides a non-null value when queried for the information. The name of the bean info class is formed by taking the full name of the target bean class (such as "sun.stuff.OurButton") and appending "BeanInfo" to form a new class name (e.g. "sun.stuff.OurButtonBeanInfo")

If a class provides explicit BeanInfo about itself then we add that to the BeanInfo information we obtained from analyzing any derived classes, but we regard the explicit information as being definitive for the current class and its base classes, and do not proceed any further up the superclass chain.

If we don't find explicit BeanInfo on a class, we use low-level reflection to study the methods of the class and apply standard design patterns to identify property accessors, event sources, or public methods. We then proceed to analyze the class's superclass and add in the information from it (and possibly on up the superclass chain).


Method Index

 o decapitalize(String)
Utility method to take a string and convert it to normal Java variable name capitalization.
 o getBeanInfo(Class)
Introspect on a Java bean and learn about all its properties, exposed methods, and events.
 o getBeanInfo(Class, Class)
Introspect on a Java bean and learn all about its properties, exposed methods, below a given "stop" point.

Methods

 o getBeanInfo
  public static BeanInfo getBeanInfo(Class beanClass) throws IntrospectionException
Introspect on a Java bean and learn about all its properties, exposed methods, and events.
Parameters:
beanClass - The bean class to be analyzed.
Returns:
A BeanInfo object describing the target bean.
 o getBeanInfo
  public static BeanInfo getBeanInfo(Class beanClass,
                                     Class stopClass) throws IntrospectionException
Introspect on a Java bean and learn all about its properties, exposed methods, below a given "stop" point.
Parameters:
bean - The bean class to be analyzed.
stopClass - The baseclass at which to stop the analysis. Any methods/properties/events in the stopClass or in its baseclasses will be ignored in the analysis.
 o decapitalize
  public static String decapitalize(String name)
Utility method to take a string and convert it to normal Java variable name capitalization. This normally means converting the first character from upper case to lower case, but in the (unusual) special case when there is more than one character and both the first and second characters are upper case, we leave it alone.

Thus "FooBah" becomes "fooBah" and "X" becomes "x", but "URL" stays as "URL".

Parameters:
name - The string to be decapitalized.
Returns:
The decapitalized version of the string.

All Packages  Class Hierarchy  This Package  Previous  Next  Index