站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 1.2.9 API 文档英文版

CachedIntrospectionResults (Spring Framework) - Spring Framework 1.2.9 API 文档英文版


org.springframework.beans
Class CachedIntrospectionResults

java.lang.Object
  extended by org.springframework.beans.CachedIntrospectionResults

final class CachedIntrospectionResults
extends Object

Internal class that caches JavaBeans PropertyDescriptor information for a Java class. Not intended for direct 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 cache 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 ClassLoader shutdown).

Information is cached statically, so we don't need to create new objects of this class for every JavaBean we manipulate. Hence, this class implements the factory design pattern, using a private constructor and a static forClass(Class) factory method to obtain instances.

Since:
05 May 2001
Author:
Rod Johnson, Juergen Hoeller
See Also:
forClass(Class)

Method Summary
static CachedIntrospectionResults forClass(Class beanClass)
          Create CachedIntrospectionResults for the given bean class.
 Class getBeanClass()
           
 BeanInfo getBeanInfo()
           
 PropertyDescriptor getPropertyDescriptor(String propertyName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

forClass

public static CachedIntrospectionResults forClass(Class beanClass)
                                           throws BeansException
Create CachedIntrospectionResults for the given bean class.

We don't want to use synchronization here. Object references are atomic, so we can live with doing the occasional unnecessary lookup at startup only.

Parameters:
beanClass - the bean class to analyze
Returns:
the corresponding CachedIntrospectionResults
Throws:
BeansException - in case of introspection failure

getBeanInfo

public BeanInfo getBeanInfo()

getBeanClass

public Class getBeanClass()

getPropertyDescriptor

public PropertyDescriptor getPropertyDescriptor(String propertyName)


Copyright (c) 2002-2007 The Spring Framework Project.