Remove section on RequiredAnnotationBeanPostProcessor in ref docs
In order to reduce the focus on the deprecated @Required support, this
commit removes the RequiredAnnotationBeanPostProcessor section and
replaces it with a TIP and an updated NOTE.
See gh-26578
@ -4698,12 +4684,21 @@ instances or the like later on. We still recommend that you put assertions into
@@ -4698,12 +4684,21 @@ instances or the like later on. We still recommend that you put assertions into
bean class itself (for example, into an init method). Doing so enforces those required
references and values even when you use the class outside of a container.
[TIP]
====
The {api-spring-framework}/beans/factory/annotation/RequiredAnnotationBeanPostProcessor.html[`RequiredAnnotationBeanPostProcessor`]
must be registered as a bean to enable support for the `@Required` annotation. Note,
however, that a `RequiredAnnotationBeanPostProcessor` bean is registered automatically
when using the `<context:annotation-config/>` or `<context:component-scan/>` XML
namespace elements.
====
[NOTE]
====
The `@Required` annotation is formally deprecated as of Spring Framework 5.1, in favor of
using constructor injection for required settings (or a custom implementation of
`InitializingBean.afterPropertiesSet()` or a custom `@PostConstruct` method along with
bean property setter methods).
The `@Required` annotation and `RequiredAnnotationBeanPostProcessor` are formally
deprecated as of Spring Framework 5.1, in favor of using constructor injection for
required settings (or a custom implementation of `InitializingBean.afterPropertiesSet()`
or a custom `@PostConstruct` method along with bean property setter methods).