示例#1
0
        private static StandardBeanInfo getBeanInfoImpl(java.lang.Class beanClass, java.lang.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
            java.lang.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;
        }