abstract class InstantiationAwareBeanPostProcessorAdapter : SmartInstantiationAwareBeanPostProcessor
Adapter that implements all methods on SmartInstantiationAwareBeanPostProcessor as no-ops, which will not change normal processing of each bean instantiated by the container. Subclasses may override merely those methods that they are actually interested in.
Note that this base class is only recommendable if you actually require InstantiationAwareBeanPostProcessor functionality. If all you need is plain BeanPostProcessor functionality, prefer a straight implementation of that (simpler) interface.
Author
Rod Johnson
Author
Juergen Hoeller
Since
2.0
InstantiationAwareBeanPostProcessorAdapter()
Adapter that implements all methods on SmartInstantiationAwareBeanPostProcessor as no-ops, which will not change normal processing of each bean instantiated by the container. Subclasses may override merely those methods that they are actually interested in. Note that this base class is only recommendable if you actually require InstantiationAwareBeanPostProcessor functionality. If all you need is plain BeanPostProcessor functionality, prefer a straight implementation of that (simpler) interface. |
open fun determineCandidateConstructors(beanClass: Class<*>, beanName: String): Array<Constructor<*>> |
|
open fun getEarlyBeanReference(bean: Any, beanName: String): Any |
|
open fun postProcessAfterInitialization(bean: Any, beanName: String): Any |
|
open fun postProcessAfterInstantiation(bean: Any, beanName: String): Boolean |
|
open fun postProcessBeforeInitialization(bean: Any, beanName: String): Any |
|
open fun postProcessBeforeInstantiation(beanClass: Class<*>, beanName: String): Any |
|
open fun postProcessPropertyValues(pvs: PropertyValues, pds: Array<PropertyDescriptor>, bean: Any, beanName: String): PropertyValues |
|
open fun predictBeanType(beanClass: Class<*>, beanName: String): Class<*> |
open class AutowiredAnnotationBeanPostProcessor : InstantiationAwareBeanPostProcessorAdapter, MergedBeanDefinitionPostProcessor, PriorityOrdered, BeanFactoryAware
org.springframework.beans.factory.config.BeanPostProcessor implementation that autowires annotated fields, setter methods and arbitrary config methods. Such members to be injected are detected through a Java 5 annotation: by default, Spring's Autowired and Value annotations. Also supports JSR-330's javax.inject.Inject annotation, if available, as a direct alternative to Spring's own Only one constructor (at max) of any given bean class may carry this annotation with the 'required' parameter set to Fields are injected right after construction of a bean, before any config methods are invoked. Such a config field does not have to be public. Config methods may have an arbitrary name and any number of arguments; each of those arguments will be autowired with a matching bean in the Spring container. Bean property setter methods are effectively just a special case of such a general config method. Config methods do not have to be public. Note: A default AutowiredAnnotationBeanPostProcessor 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 AutowiredAnnotationBeanPostProcessor bean definition. NOTE: Annotation injection will be performed before XML injection; thus the latter configuration will override the former for properties wired through both approaches. In addition to regular injection points as discussed above, this post-processor also handles Spring's Lookup annotation which identifies lookup methods to be replaced by the container at runtime. This is essentially a type-safe version of |
|
open class RequiredAnnotationBeanPostProcessor : InstantiationAwareBeanPostProcessorAdapter, MergedBeanDefinitionPostProcessor, PriorityOrdered, BeanFactoryAware
org.springframework.beans.factory.config.BeanPostProcessor implementation 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 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 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. |
|
open class ScriptFactoryPostProcessor : InstantiationAwareBeanPostProcessorAdapter, BeanClassLoaderAware, BeanFactoryAware, ResourceLoaderAware, DisposableBean, Ordered
org.springframework.beans.factory.config.BeanPostProcessor that handles org.springframework.scripting.ScriptFactory definitions, replacing each factory with the actual scripted Java object generated by it. This is similar to the org.springframework.beans.factory.FactoryBean mechanism, but is specifically tailored for scripts and not built into Spring's core container itself but rather implemented as an extension. NOTE: The most important characteristic of this post-processor is that constructor arguments are applied to the org.springframework.scripting.ScriptFactory instance while bean property values are applied to the generated scripted object. Typically, constructor arguments include a script source locator and potentially script interfaces, while bean property values include references and config values to inject into the scripted object itself. The following ScriptFactoryPostProcessor will automatically be applied to the two org.springframework.scripting.ScriptFactory definitions below. At runtime, the actual scripted objects will be exposed for "bshMessenger" and "groovyMessenger", rather than the org.springframework.scripting.ScriptFactory instances. Both of those are supposed to be castable to the example's
NOTE: Please note that the above excerpt from a Spring XML bean definition file uses just the <bean/>-style syntax (in an effort to illustrate using the ScriptFactoryPostProcessor itself). In reality, you would never create a <bean/> definition for a ScriptFactoryPostProcessor explicitly; rather you would import the tags from the The Spring reference documentation contains numerous examples of using tags in the
|