src/share/classes/java/beans/Introspector.java

Print this page




  70  * Thus for a class such as "sun.xyz.OurButton" we would first look for a
  71  * BeanInfo class called "sun.xyz.OurButtonBeanInfo" and if that failed we'd
  72  * look in each package in the BeanInfo search path for an OurButtonBeanInfo
  73  * class.  With the default search path, this would mean looking for
  74  * "sun.beans.infos.OurButtonBeanInfo".
  75  * <p>
  76  * If a class provides explicit BeanInfo about itself then we add that to
  77  * the BeanInfo information we obtained from analyzing any derived classes,
  78  * but we regard the explicit information as being definitive for the current
  79  * class and its base classes, and do not proceed any further up the superclass
  80  * chain.
  81  * <p>
  82  * If we don't find explicit BeanInfo on a class, we use low-level
  83  * reflection to study the methods of the class and apply standard design
  84  * patterns to identify property accessors, event sources, or public
  85  * methods.  We then proceed to analyze the class's superclass and add
  86  * in the information from it (and possibly on up the superclass chain).
  87  * <p>
  88  * For more information about introspection and design patterns, please
  89  * consult the
  90  *  <a href="http://java.sun.com/products/javabeans/docs/index.html">JavaBeans&trade; specification</a>.
  91  */
  92 
  93 public class Introspector {
  94 
  95     // Flags that can be used to control getBeanInfo:
  96     /**
  97      * Flag to indicate to use of all beaninfo.
  98      */
  99     public final static int USE_ALL_BEANINFO           = 1;
 100     /**
 101      * Flag to indicate to ignore immediate beaninfo.
 102      */
 103     public final static int IGNORE_IMMEDIATE_BEANINFO  = 2;
 104     /**
 105      * Flag to indicate to ignore all beaninfo.
 106      */
 107     public final static int IGNORE_ALL_BEANINFO        = 3;
 108 
 109     // Static Caches to speed up introspection.
 110     private static final WeakCache<Class<?>, Method[]> declaredMethodCache = new WeakCache<>();




  70  * Thus for a class such as "sun.xyz.OurButton" we would first look for a
  71  * BeanInfo class called "sun.xyz.OurButtonBeanInfo" and if that failed we'd
  72  * look in each package in the BeanInfo search path for an OurButtonBeanInfo
  73  * class.  With the default search path, this would mean looking for
  74  * "sun.beans.infos.OurButtonBeanInfo".
  75  * <p>
  76  * If a class provides explicit BeanInfo about itself then we add that to
  77  * the BeanInfo information we obtained from analyzing any derived classes,
  78  * but we regard the explicit information as being definitive for the current
  79  * class and its base classes, and do not proceed any further up the superclass
  80  * chain.
  81  * <p>
  82  * If we don't find explicit BeanInfo on a class, we use low-level
  83  * reflection to study the methods of the class and apply standard design
  84  * patterns to identify property accessors, event sources, or public
  85  * methods.  We then proceed to analyze the class's superclass and add
  86  * in the information from it (and possibly on up the superclass chain).
  87  * <p>
  88  * For more information about introspection and design patterns, please
  89  * consult the
  90  *  <a href="http://www.oracle.com/technetwork/java/index.html">JavaBeans&trade; specification</a>.
  91  */
  92 
  93 public class Introspector {
  94 
  95     // Flags that can be used to control getBeanInfo:
  96     /**
  97      * Flag to indicate to use of all beaninfo.
  98      */
  99     public final static int USE_ALL_BEANINFO           = 1;
 100     /**
 101      * Flag to indicate to ignore immediate beaninfo.
 102      */
 103     public final static int IGNORE_IMMEDIATE_BEANINFO  = 2;
 104     /**
 105      * Flag to indicate to ignore all beaninfo.
 106      */
 107     public final static int IGNORE_ALL_BEANINFO        = 3;
 108 
 109     // Static Caches to speed up introspection.
 110     private static final WeakCache<Class<?>, Method[]> declaredMethodCache = new WeakCache<>();