Class taken originally from Spring Framework. Caches PropertyDescriptor information for a Java
class. Package-visible; not for use by application code.
Necessary as Introspector.getBeanInfo() in JDK 1.3 will return a new deep copy of the BeanInfo
every time we ask for it. We take the opportunity to hash property descriptors by method name for
fast lookup. Furthermore, we do our own caching of descriptors here, rather than rely on the
JDK's system-wide BeanInfo cache (to avoid leaks on class loader shutdown).
Information is cached statically, so we don't need to create new objects of this class for every
JavaBean we manipulate. Thus this class implements the factory design pattern, using a private
constructor and a static forClass method to obtain instances.
Phil Zoio: lifted from Spring source and package renamed to remove Spring as a runtime mandatory
distribution file. Other changes:
- Java 5 type safety compliance.
- No longer throws BeansException.
author: Rod Johnson author: Juergen Hoeller author: Phil Zoio since: 05 May 2001 |