@@ -4316,31 +4316,29 @@ org.springframework.scripting.groovy.GroovyMessenger@272961
4316
4316
----
4317
4317
4318
4318
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
+
4319
4328
[[beans-factory-extension-bpp-examples-rabpp]]
4320
4329
==== Example: The `RequiredAnnotationBeanPostProcessor`
4321
4330
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.
4328
4335
4329
4336
[NOTE]
4330
4337
====
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.
4333
4340
====
4334
4341
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
-
4344
4342
4345
4343
4346
4344
[[beans-factory-extension-factory-postprocessors]]
@@ -4603,7 +4601,7 @@ An alternative to XML setup is provided by annotation-based configuration, which
4603
4601
the bytecode metadata for wiring up components instead of angle-bracket declarations.
4604
4602
Instead of using XML to describe a bean wiring, the developer moves the configuration
4605
4603
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
4607
4605
a `BeanPostProcessor` in conjunction with annotations is a common means of extending the
4608
4606
Spring IoC container. For example, Spring 2.0 introduced the possibility of enforcing
4609
4607
required properties with the <<beans-required-annotation,`@Required`>> annotation. Spring
@@ -4645,8 +4643,7 @@ configuration (notice the inclusion of the `context` namespace):
4645
4643
(The implicitly registered post-processors include
4646
4644
{api-spring-framework}/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.html[`AutowiredAnnotationBeanPostProcessor`],
4647
4645
{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
4650
4647
{api-spring-framework}/beans/factory/annotation/RequiredAnnotationBeanPostProcessor.html[`RequiredAnnotationBeanPostProcessor`].)
4651
4648
4652
4649
[NOTE]
@@ -4693,7 +4690,6 @@ example:
4693
4690
}
4694
4691
----
4695
4692
4696
-
4697
4693
This annotation indicates that the affected bean property must be populated at
4698
4694
configuration time, through an explicit property value in a bean definition or through
4699
4695
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.
4704
4700
4705
4701
[NOTE]
4706
4702
====
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).
4710
4707
====
4711
4708
4712
4709
0 commit comments