Skip to content

Commit 6d2fec3

Browse files
committed
Reduce focus on RequiredAnnotationBeanPostProcessor in ref docs
See gh-26578
1 parent 90ee22f commit 6d2fec3

File tree

1 file changed

+21
-24
lines changed

1 file changed

+21
-24
lines changed

src/docs/asciidoc/core/core-beans.adoc

+21-24
Original file line numberDiff line numberDiff line change
@@ -4316,31 +4316,29 @@ org.springframework.scripting.groovy.GroovyMessenger@272961
43164316
----
43174317

43184318

4319+
[[beans-factory-extension-bpp-examples-aabpp]]
4320+
==== Example: The `AutowiredAnnotationBeanPostProcessor`
4321+
4322+
Using callback interfaces or annotations in conjunction with a custom `BeanPostProcessor`
4323+
implementation is a common means of extending the Spring IoC container. An example is
4324+
Spring's `AutowiredAnnotationBeanPostProcessor` -- a `BeanPostProcessor` implementation
4325+
that ships with the Spring distribution and autowires annotated fields, setter methods,
4326+
and arbitrary config methods.
4327+
43194328
[[beans-factory-extension-bpp-examples-rabpp]]
43204329
==== Example: The `RequiredAnnotationBeanPostProcessor`
43214330

4322-
Using callback interfaces or annotations in conjunction with a custom
4323-
`BeanPostProcessor` implementation is a common means of extending the Spring IoC
4324-
container. An example is Spring's `RequiredAnnotationBeanPostProcessor` -- a
4325-
`BeanPostProcessor` implementation that ships with the Spring distribution and that ensures
4326-
that JavaBean properties on beans that are marked with an (arbitrary) annotation are
4327-
actually (configured to be) dependency-injected with a value.
4331+
Spring's `RequiredAnnotationBeanPostProcessor` is a `BeanPostProcessor` implementation
4332+
that ships with the Spring distribution and that ensures that JavaBean properties on
4333+
beans that are marked with an (arbitrary) annotation are actually (configured to be)
4334+
dependency-injected with a value.
43284335

43294336
[NOTE]
43304337
====
4331-
The `@RequiredAnnotationBeanPostProcessor` is formally deprecated as of Spring Framework 5.1,
4332-
see NOTE in <<beans-required-annotation,`@Required`>> annotation for details.
4338+
The `RequiredAnnotationBeanPostProcessor` is formally deprecated as of Spring Framework
4339+
5.1. See note in the section on <<beans-required-annotation,`@Required`>> for details.
43334340
====
43344341

4335-
[[beans-factory-extension-bpp-examples-aabpp]]
4336-
==== Example: The `AutowiredAnnotationBeanPostProcessor`
4337-
4338-
Using callback interfaces or annotations in conjunction with a custom
4339-
`BeanPostProcessor` implementation is a common means of extending the Spring IoC
4340-
container. An example is Spring's `AutowiredAnnotationBeanPostProcessor` -- a
4341-
`BeanPostProcessor` implementation that ships with the Spring distribution and autowires
4342-
annotated fields, setter methods, and arbitrary config methods.
4343-
43444342

43454343

43464344
[[beans-factory-extension-factory-postprocessors]]
@@ -4603,7 +4601,7 @@ An alternative to XML setup is provided by annotation-based configuration, which
46034601
the bytecode metadata for wiring up components instead of angle-bracket declarations.
46044602
Instead of using XML to describe a bean wiring, the developer moves the configuration
46054603
into the component class itself by using annotations on the relevant class, method, or
4606-
field declaration. As mentioned in <<beans-factory-extension-bpp-examples-rabpp>>, using
4604+
field declaration. As mentioned in <<beans-factory-extension-bpp-examples-aabpp>>, using
46074605
a `BeanPostProcessor` in conjunction with annotations is a common means of extending the
46084606
Spring IoC container. For example, Spring 2.0 introduced the possibility of enforcing
46094607
required properties with the <<beans-required-annotation,`@Required`>> annotation. Spring
@@ -4645,8 +4643,7 @@ configuration (notice the inclusion of the `context` namespace):
46454643
(The implicitly registered post-processors include
46464644
{api-spring-framework}/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.html[`AutowiredAnnotationBeanPostProcessor`],
46474645
{api-spring-framework}/context/annotation/CommonAnnotationBeanPostProcessor.html[`CommonAnnotationBeanPostProcessor`],
4648-
{api-spring-framework}/orm/jpa/support/PersistenceAnnotationBeanPostProcessor.html[`PersistenceAnnotationBeanPostProcessor`],
4649-
and the aforementioned
4646+
{api-spring-framework}/orm/jpa/support/PersistenceAnnotationBeanPostProcessor.html[`PersistenceAnnotationBeanPostProcessor`], and
46504647
{api-spring-framework}/beans/factory/annotation/RequiredAnnotationBeanPostProcessor.html[`RequiredAnnotationBeanPostProcessor`].)
46514648

46524649
[NOTE]
@@ -4693,7 +4690,6 @@ example:
46934690
}
46944691
----
46954692

4696-
46974693
This annotation indicates that the affected bean property must be populated at
46984694
configuration time, through an explicit property value in a bean definition or through
46994695
autowiring. The container throws an exception if the affected bean property has not been
@@ -4704,9 +4700,10 @@ references and values even when you use the class outside of a container.
47044700

47054701
[NOTE]
47064702
====
4707-
The `@Required` annotation is formally deprecated as of Spring Framework 5.1, in favor
4708-
of using constructor injection for required settings (or a custom implementation of
4709-
`InitializingBean.afterPropertiesSet()` along with bean property setter methods).
4703+
The `@Required` annotation is formally deprecated as of Spring Framework 5.1, in favor of
4704+
using constructor injection for required settings (or a custom implementation of
4705+
`InitializingBean.afterPropertiesSet()` or a custom `@PostConstruct` method along with
4706+
bean property setter methods).
47104707
====
47114708

47124709

0 commit comments

Comments
 (0)