java.lang.Objectorg.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor
All Implemented Interfaces:
PriorityOrdered, SmartInstantiationAwareBeanPostProcessor
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 implemented (and may
still be desirable), because all that this class does is enforce 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.
Rob - HarropJuergen - Hoeller2.0 - | Method from org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor Summary: |
|---|
| getOrder, getRequiredAnnotationType, isRequiredProperty, postProcessPropertyValues, setOrder, setRequiredAnnotationType |
| Methods from org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter: |
|---|
| determineCandidateConstructors, getEarlyBeanReference, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, postProcessPropertyValues, predictBeanType |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor Detail: |
|---|
|
|
This implementation looks for the existence of a "required" annotation on the supplied property . |
|
|
The default required annotation type is the Spring-provided Required annotation. This setter property exists so that developers can provide their own (non-Spring-specific) annotation type to indicate that a property value is required. |