org.springframework.beans
Class CachedIntrospectionResults

java.lang.Object
  extended byorg.springframework.beans.CachedIntrospectionResults

final class CachedIntrospectionResults
extends java.lang.Object

Class to cache 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.

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.

Since:
05 May 2001
Author:
Rod Johnson, Juergen Hoeller

Method Summary
(package private) static CachedIntrospectionResults forClass(java.lang.Class clazz)
          We might use this from the EJB tier, so we don't want to use synchronization.
(package private)  java.lang.Class getBeanClass()
           
(package private)  java.beans.BeanInfo getBeanInfo()
           
(package private)  java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String propertyName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

forClass

static CachedIntrospectionResults forClass(java.lang.Class clazz)
                                    throws BeansException
We might use this from the EJB tier, so we don't want to use synchronization. Object references are atomic, so we can live with doing the occasional unnecessary lookup at startup only.

Throws:
BeansException

getBeanInfo

java.beans.BeanInfo getBeanInfo()

getBeanClass

java.lang.Class getBeanClass()

getPropertyDescriptor

java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String propertyName)


Copyright (C) 2003-2004 The Spring Framework Project.