that enforces required JavaBean properties to have been configured.
Required bean properties are detected through a Java 5 annotation:
by default, Spring's Required annotation.
The motivation for the existence of this BeanPostProcessor is to allow
developers to annotate the setter properties of their own classes with an
arbitrary JDK 1.5 annotation to indicate that the container must check
for the configuration of a dependency injected value. This neatly pushes
responsibility for such checking onto the container (where it arguably belongs),
and obviates the need (in part) for a developer to code a method that
simply checks that all required properties have actually been set.
Please note that an 'init' method may still need to be implemented (and may
still be desirable), because all that this class does is enforcing that a
'required' property has actually been configured with a value. It does
not check anything else... In particular, it does not check that a
configured value is not null.
Note: A default RequiredAnnotationBeanPostProcessor will be registered
by the "context:annotation-config" and "context:component-scan" XML tags.
Remove or turn off the default annotation configuration there if you intend
to specify a custom RequiredAnnotationBeanPostProcessor bean definition.
Post-process the given property values before the factory applies them
to the given bean. Allows for checking whether all dependencies have been
satisfied, for example based on a "Required" annotation on bean property setters.
Also allows for replacing the property values to apply, typically through
creating a new MutablePropertyValues instance based on the original PropertyValues,
adding or removing specific values.
The default implementation returns the given pvs as-is.
Check whether the given bean definition is not subject to the annotation-based
required property check as performed by this post-processor.
The default implementations check for the presence of the
SKIP_REQUIRED_CHECK_ATTRIBUTE attribute in the bean definition, if any.
It also suggests skipping in case of a bean definition with a "factory-bean"
reference set, assuming that instance-based factories pre-populate the bean.