From 5740eaf33e25baaeab496b9dd9e91e2caaeab430 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 21 Apr 2021 14:15:27 +0200 Subject: [PATCH] Polishing --- src/docs/asciidoc/core/core-beans.adoc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/docs/asciidoc/core/core-beans.adoc b/src/docs/asciidoc/core/core-beans.adoc index 3885a714f6b..bc7e7a01849 100644 --- a/src/docs/asciidoc/core/core-beans.adoc +++ b/src/docs/asciidoc/core/core-beans.adoc @@ -847,12 +847,12 @@ This approach shows that the factory bean itself can be managed and configured t dependency injection (DI). See <>. -NOTE: In Spring documentation, "`factory bean`" refers to a bean that is configured in -the Spring container and that creates objects through an +NOTE: In Spring documentation, "factory bean" refers to a bean that is configured in the +Spring container and that creates objects through an <> or <> factory method. By contrast, `FactoryBean` (notice the capitalization) refers to a Spring-specific -<> implementation class. +<> implementation class. [[beans-factory-type-determination]] @@ -3350,8 +3350,9 @@ of the scope. You can also do the `Scope` registration declaratively, by using t ---- -NOTE: When you place `` in a `FactoryBean` implementation, it is the factory -bean itself that is scoped, not the object returned from `getObject()`. +NOTE: When you place `` within a `` declaration for a +`FactoryBean` implementation, it is the factory bean itself that is scoped, not the object +returned from `getObject()`. @@ -4545,16 +4546,16 @@ The `FactoryBean` interface provides three methods: instance can possibly be shared, depending on whether this factory returns singletons or prototypes. * `boolean isSingleton()`: Returns `true` if this `FactoryBean` returns singletons or - `false` otherwise. + `false` otherwise. The default implementation of this method returns `true`. * `Class getObjectType()`: Returns the object type returned by the `getObject()` method or `null` if the type is not known in advance. -The `FactoryBean` concept and interface is used in a number of places within the Spring +The `FactoryBean` concept and interface are used in a number of places within the Spring Framework. More than 50 implementations of the `FactoryBean` interface ship with Spring itself. When you need to ask a container for an actual `FactoryBean` instance itself instead of -the bean it produces, preface the bean's `id` with the ampersand symbol (`&`) when +the bean it produces, prefix the bean's `id` with the ampersand symbol (`&`) when calling the `getBean()` method of the `ApplicationContext`. So, for a given `FactoryBean` with an `id` of `myBean`, invoking `getBean("myBean")` on the container returns the product of the `FactoryBean`, whereas invoking `getBean("&myBean")` returns the