1
1
/*
2
- * Copyright 2002-2020 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
39
39
*
40
40
* <p><b>{@code FactoryBean} is a programmatic contract. Implementations are not
41
41
* supposed to rely on annotation-driven injection or other reflective facilities.</b>
42
- * {@link #getObjectType()} {@link #getObject()} invocations may arrive early in the
43
- * bootstrap process, even ahead of any post-processor setup. If you need access to
44
- * other beans, implement {@link BeanFactoryAware} and obtain them programmatically.
42
+ * Invocations of {@link #getObjectType()} and {@link #getObject()} may arrive early
43
+ * in the bootstrap process, even ahead of any post-processor setup. If you need access
44
+ * to other beans, implement {@link BeanFactoryAware} and obtain them programmatically.
45
45
*
46
46
* <p><b>The container is only responsible for managing the lifecycle of the FactoryBean
47
47
* instance, not the lifecycle of the objects created by the FactoryBean.</b> Therefore,
50
50
* {@link DisposableBean} and delegate any such close call to the underlying object.
51
51
*
52
52
* <p>Finally, FactoryBean objects participate in the containing BeanFactory's
53
- * synchronization of bean creation. There is usually no need for internal
53
+ * synchronization of bean creation. Thus, there is usually no need for internal
54
54
* synchronization other than for purposes of lazy initialization within the
55
55
* FactoryBean itself (or the like).
56
56
*
@@ -68,7 +68,7 @@ public interface FactoryBean<T> {
68
68
* The name of an attribute that can be
69
69
* {@link org.springframework.core.AttributeAccessor#setAttribute set} on a
70
70
* {@link org.springframework.beans.factory.config.BeanDefinition} so that
71
- * factory beans can signal their object type when it can't be deduced from
71
+ * factory beans can signal their object type when it cannot be deduced from
72
72
* the factory bean class.
73
73
* @since 5.2
74
74
*/
@@ -79,15 +79,15 @@ public interface FactoryBean<T> {
79
79
* Return an instance (possibly shared or independent) of the object
80
80
* managed by this factory.
81
81
* <p>As with a {@link BeanFactory}, this allows support for both the
82
- * Singleton and Prototype design pattern .
82
+ * Singleton and Prototype design patterns .
83
83
* <p>If this FactoryBean is not fully initialized yet at the time of
84
84
* the call (for example because it is involved in a circular reference),
85
85
* throw a corresponding {@link FactoryBeanNotInitializedException}.
86
- * <p>As of Spring 2.0, FactoryBeans are allowed to return {@code null}
87
- * objects. The factory will consider this as normal value to be used; it
88
- * will not throw a FactoryBeanNotInitializedException in this case anymore.
86
+ * <p>FactoryBeans are allowed to return {@code null} objects. The bean
87
+ * factory will consider this as a normal value to be used and will not throw
88
+ * a {@code FactoryBeanNotInitializedException} in this case. However,
89
89
* FactoryBean implementations are encouraged to throw
90
- * FactoryBeanNotInitializedException themselves now , as appropriate.
90
+ * {@code FactoryBeanNotInitializedException} themselves, as appropriate.
91
91
* @return an instance of the bean (can be {@code null})
92
92
* @throws Exception in case of creation errors
93
93
* @see FactoryBeanNotInitializedException
@@ -100,7 +100,7 @@ public interface FactoryBean<T> {
100
100
* or {@code null} if not known in advance.
101
101
* <p>This allows one to check for specific types of beans without
102
102
* instantiating objects, for example on autowiring.
103
- * <p>In the case of implementations that are creating a singleton object,
103
+ * <p>In the case of implementations that create a singleton object,
104
104
* this method should try to avoid singleton creation as far as possible;
105
105
* it should rather estimate the type in advance.
106
106
* For prototypes, returning a meaningful type here is advisable too.
@@ -121,8 +121,8 @@ public interface FactoryBean<T> {
121
121
* Is the object managed by this factory a singleton? That is,
122
122
* will {@link #getObject()} always return the same object
123
123
* (a reference that can be cached)?
124
- * <p><b>NOTE:</b> If a FactoryBean indicates to hold a singleton object,
125
- * the object returned from {@code getObject()} might get cached
124
+ * <p><b>NOTE:</b> If a FactoryBean indicates that it holds a singleton
125
+ * object, the object returned from {@code getObject()} might get cached
126
126
* by the owning BeanFactory. Hence, do not return {@code true}
127
127
* unless the FactoryBean always exposes the same reference.
128
128
* <p>The singleton status of the FactoryBean itself will generally
0 commit comments