Class StandardBeanInfoFactory
- All Implemented Interfaces:
BeanInfoFactory
,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()
Get the order value of this object.
-
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
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()Description copied from interface:Ordered
Get the order value of this object.Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet
load-on-startup
values).Same order values will result in arbitrary sort positions for the affected objects.
-