/** * Returns a Map of all the available properties on a given class including * write-only and indexed properties. * * @return Map<String, BeanProperty> an unmodifiable mapping of property * names (Strings) to BeanProperty objects. * */ 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; } }
/** * Returns a Map of all the available properties on a given class including * write-only and indexed properties. * * @return Map<String, BeanProperty> an unmodifiable mapping of property * names (Strings) to BeanProperty objects. * */ 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; } }