Returns the bean mappings for a given class (caches the results).
767649
@SuppressWarnings("unchecked")
    static final <T> Beans<T> of(Class<T> clazz) {
        return ((CachedBeans<T>)CachedBeans.CACHE).getBeans(clazz);
    }
489592
public static <T> Map<String, Object> toMap(T bean) {
        Map<String, Object> map = null;
        try {
            map = PropertyUtils.describe(bean);
            map.remove("class");
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return map;
    }
1298921
public <T> List<T> find(Entity where, Class<T> beanClass) throws SQLException {
		return find(where.getFieldNames(), where, BeanListHandler.create(beanClass));
	}
1306430
private static String[] fieldNames(Class<?> beanType) {
        Field[] fields = Stream.of(beanType.getDeclaredFields())
                .filter(f -> !Modifier.isStatic(f.getModifiers()) && f.getAnnotation(PropertyDefinition.class) != null)
                .toArray(Field[]::new);
        List<String> fieldNames = new ArrayList<>();
        for (int i = 0; i < fields.length; i++) {
            fieldNames.add(fields[i].getName());
        }
        return fieldNames.toArray(new String[fieldNames.size()]);
    }
921233
protected static function loadMappings(/*# string */ $class)
    {
        // mapping status changed ?
        if (self::isStatusUpdated()) {
            self::resetMappings();
            self::setStatus(false);
        }

        // $class' mapping loaded already
        if ($class::hasMappings()) {
            return;
        }

        // load $class mapping
        $loadedClass = $class::hasLoader();
        if ($loadedClass) {
            // loader found
            $class::setMappings(
                $loadedClass::getLoader()->loadMessages($class)
            );
        } else {
            // no loader found
            $class::setMappings([]);
        }
    }
1352716
private static BeanProperty[][] getBeanProperties(Class beanType, PropertySet set) {
        List readProperties = new ArrayList();
        List writeProperties = new ArrayList();

        Map map = BeanIntrospector.getAllProperties(beanType);

        Iterator it = map.values().iterator();
        while (it.hasNext()) {
            BeanProperty bp = (BeanProperty)it.next();

            if (set == PropertySet.READ_WRITE ||
                set == PropertySet.READ_WRITE_UNCHECKED_EXCEPTIONS)
            {
                if (bp.getReadMethod() == null || bp.getWriteMethod() == null) {
                    continue;
                }
            }
 
            boolean checkedAllowed = 
                set != PropertySet.UNCHECKED_EXCEPTIONS &&
                set != PropertySet.READ_WRITE_UNCHECKED_EXCEPTIONS;

            if (bp.getReadMethod() != null) {
                if (checkedAllowed || !throwsCheckedException(bp.getReadMethod())) {
                    readProperties.add(bp);
                }
            }
            if (bp.getWriteMethod() != null) {
                if (checkedAllowed || !throwsCheckedException(bp.getWriteMethod())) {
                    writeProperties.add(bp);
                }
            }
        }

        BeanProperty[][] props = new BeanProperty[2][];
        
        props[0] = new BeanProperty[readProperties.size()];
        readProperties.toArray(props[0]);
        props[1] = new BeanProperty[writeProperties.size()];
        writeProperties.toArray(props[1]);

        return props;
    }
1240767
public String[] getSuperclasses(String cls) {
    List<String>	result;

    result = new ArrayList<>();

    for (String superclass: m_CacheNames.keySet()) {
      if (m_CacheNames.get(superclass).contains(cls))
        result.add(superclass);
    }

    if (result.size() > 1)
      Collections.sort(result);

    return result.toArray(new String[result.size()]);
  }
635338
protected List getBeansToUpdate(Class beanType) {
        final ApplicationContext ac = getApplicationContext();
        final List listeners = new ArrayList();

        if( ac != null ) {
            if( logger.isDebugEnabled() )
                logger.debug( "Constructing list of beans to notify; bean type=" + beanType.getName() );

            final Map map = ac.getBeansOfType( beanType, false, true );

            if( logger.isDebugEnabled() )
                logger.debug( "bean map: " + map );

            listeners.addAll( map.values() );
            listeners.addAll( getNonSingletonListeners( beanType ) );
        }

        if( logger.isDebugEnabled() )
            logger.debug( "List of beans to notify:" + listeners );

        return listeners;
    }
1059967
public static <T> List<Field> getAnnotatedFields(Object object, Class<? extends Annotation> annotationClass) {
		return getAnnotatedFields(object.getClass(), annotationClass);
	}
1331191
public static List<Bean> findLazy(Set<BeanId> ids) {
        if (ids.size() == 0) {
            return new ArrayList<>();
        }
        JpaBeanQueryAssembler query = new JpaBeanQueryAssembler(ids);
        List<JpaProperty> allProperties = JpaProperty.findProperties(query.getIds());
        query.addProperties(allProperties);
        Multimap<BeanId, JpaRef> refs = JpaRef.findReferences(ids);
        if (refs.size() > 0) {
            query.addRefs(refs);
        }
        return query.assembleBeans();
    }
474571
public <K, V> Map<K, V> asMap(Class<K> keyClass, Class<V> valueClass) {
      return asMap(HashMap.class, keyClass, valueClass);
   }
972909
public static SortedMap<String, Object> asMap(Object bean) {
        if (bean == null) {
            throw new IllegalArgumentException();
        }
        BeanPropertyMapFactory factory = forClass(bean.getClass());
        return factory.createMap(bean);
    }
1105919
public <T> Mapping<T> getMapping(Class<T> clazz) {
        return (cache != null) ? cache.getMapping(clazz, annotationSet)
                : new Mapping<T>(clazz, annotationSet);
    }
750257
public static <K, V> Maybe<Map<K, V>> getAll(String key, Class<K> kClazz, Class<V> vClazz) {
        return getAll(CacheService.CACHE_CONFIG_BEAN, key, kClazz, vClazz);
    }
577639
public <T> Map<String, T> findByTypeWithName(Class<T> type) {
        return BeanFactoryUtils.beansOfTypeIncludingAncestors(applicationContext, type);
    }
953344
public static Map<String, BeanProperty> getAllProperties(Class clazz) {
        synchronized (cPropertiesCache) {
            Map<String, BeanProperty> properties;
            SoftReference<Map<String, BeanProperty>> ref = cPropertiesCache.get(clazz);
            if (ref != null) {
                properties = ref.get();
                if (properties != null) {
                    return properties;
                }
            }
            properties = createProperties(clazz);
            cPropertiesCache.put(clazz, new SoftReference<Map<String, BeanProperty>>(properties));
            return properties;
        }
    }
446815
private EJBKey[] getEJBKeys(BeanO[] beans)
    {
        EJBKey result[] = null;
        if (beans != null) {
            result = new EJBKey[beans.length];
            for (int i = 0; i < beans.length; ++i) {
                result[i] = beans[i].getId();
            }
        }
        return result;
    }