Class StandardBeanInfoFactory
- All Implemented Interfaces:
BeanInfoFactory
,org.springframework.core.Ordered
- Direct Known Subclasses:
ExtendedBeanInfoFactory
BeanInfoFactory
implementation that performs standard
Introspector
inspection.
To be configured via a META-INF/spring.factories
file with the following content:
org.springframework.beans.BeanInfoFactory=org.springframework.beans.StandardBeanInfoFactory
Ordered at Ordered.LOWEST_PRECEDENCE
to allow other user-defined
BeanInfoFactory
types to take precedence.
- Since:
- 6.0
- Author:
- Juergen Hoeller
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
System property that instructs Spring to use theIntrospector.IGNORE_ALL_BEANINFO
mode when calling the JavaBeansIntrospector
: "spring.beaninfo.ignore", with a value of "true" skipping the search forBeanInfo
classes (typically for scenarios where no such classes are being defined for beans in the application in the first place).Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetBeanInfo
(Class<?> beanClass) Return the bean info for the given class, if supported.int
getOrder()
-
Field Details
-
IGNORE_BEANINFO_PROPERTY_NAME
System property that instructs Spring to use theIntrospector.IGNORE_ALL_BEANINFO
mode when calling the JavaBeansIntrospector
: "spring.beaninfo.ignore", with a value of "true" skipping the search forBeanInfo
classes (typically for scenarios where no such classes are being defined for beans in the application in the first place).The default is "false", considering all
BeanInfo
metadata classes, like for standardIntrospector.getBeanInfo(Class)
calls. Consider switching this flag to "true" if you experience repeated ClassLoader access for non-existingBeanInfo
classes, in case such access is expensive on startup or on lazy loading.Note that such an effect may also indicate a scenario where caching doesn't work effectively: Prefer an arrangement where the Spring jars live in the same ClassLoader as the application classes, which allows for clean caching along with the application's lifecycle in any case. For a web application, consider declaring a local
org.springframework.web.util.IntrospectorCleanupListener
inweb.xml
in case of a multi-ClassLoader layout, which will allow for effective caching as well.
-
-
Constructor Details
-
StandardBeanInfoFactory
public StandardBeanInfoFactory()
-
-
Method Details
-
getBeanInfo
Description copied from interface:BeanInfoFactory
Return the bean info for the given class, if supported.- Specified by:
getBeanInfo
in interfaceBeanInfoFactory
- Parameters:
beanClass
- the bean class- Returns:
- the BeanInfo, or
null
if the given class is not supported - Throws:
IntrospectionException
- in case of exceptions
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-