Esempio n. 1
0
  private static StandardBeanInfo getBeanInfoImpl(Class<?> beanClass, Class<?> stopClass, int flags)
      throws IntrospectionException {
    BeanInfo explicitInfo = null;
    if (flags == USE_ALL_BEANINFO) {
      explicitInfo = getExplicitBeanInfo(beanClass);
    }
    StandardBeanInfo beanInfo = new StandardBeanInfo(beanClass, explicitInfo, stopClass);

    if (beanInfo.additionalBeanInfo != null) {
      for (int i = beanInfo.additionalBeanInfo.length - 1; i >= 0; i--) {
        BeanInfo info = beanInfo.additionalBeanInfo[i];
        beanInfo.mergeBeanInfo(info, true);
      }
    }

    // recursive get beaninfo for super classes
    Class<?> beanSuperClass = beanClass.getSuperclass();
    if (beanSuperClass != stopClass) {
      if (beanSuperClass == null)
        throw new IntrospectionException(
            "Stop class is not super class of bean class"); //$NON-NLS-1$
      int superflags = flags == IGNORE_IMMEDIATE_BEANINFO ? USE_ALL_BEANINFO : flags;
      BeanInfo superBeanInfo = getBeanInfoImpl(beanSuperClass, stopClass, superflags);
      if (superBeanInfo != null) {
        beanInfo.mergeBeanInfo(superBeanInfo, false);
      }
    }
    return beanInfo;
  }
Esempio n. 2
0
 private static StandardBeanInfo getBeanInfoImplAndInit(
     Class<?> beanClass, Class<?> stopClass, int flag) throws IntrospectionException {
   StandardBeanInfo standardBeanInfo = getBeanInfoImpl(beanClass, stopClass, flag);
   standardBeanInfo.init();
   return standardBeanInfo;
 }