public abstract class AbstractAnnotationBeanPostProcessor
extends org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
implements org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor, org.springframework.core.PriorityOrdered, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.context.EnvironmentAware, org.springframework.beans.factory.DisposableBean
BeanPostProcessor implementation for customized annotation that annotated injected-object.| 限定符和类型 | 类和说明 |
|---|---|
class |
AbstractAnnotationBeanPostProcessor.AnnotatedFieldElement
|
| 构造器和说明 |
|---|
AbstractAnnotationBeanPostProcessor(Class<? extends Annotation>... annotationTypes) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected abstract String |
buildInjectedObjectCacheKey(org.springframework.core.annotation.AnnotationAttributes attributes,
Object bean,
String beanName,
Class<?> injectedType,
org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement injectedElement)
Build a cache key for injected-object.
|
void |
destroy() |
protected abstract Object |
doGetInjectedBean(org.springframework.core.annotation.AnnotationAttributes attributes,
Object bean,
String beanName,
Class<?> injectedType,
org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement injectedElement)
Subclass must implement this method to get injected-object.
|
Class<? extends Annotation> |
getAnnotationType()
已过时。
2.7.3, uses
getAnnotationTypes() |
protected Class<? extends Annotation>[] |
getAnnotationTypes() |
protected org.springframework.beans.factory.config.ConfigurableListableBeanFactory |
getBeanFactory() |
protected ClassLoader |
getClassLoader() |
protected org.springframework.core.env.Environment |
getEnvironment() |
protected Map<org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement,Object> |
getInjectedFieldObjectsMap()
Get
Map in injected field. |
protected Map<org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement,Object> |
getInjectedMethodObjectsMap()
Get
Map in injected method. |
protected Object |
getInjectedObject(org.springframework.core.annotation.AnnotationAttributes attributes,
Object bean,
String beanName,
Class<?> injectedType,
org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement injectedElement)
Get injected-object from specified
annotation attributes and Bean Class |
protected Collection<Object> |
getInjectedObjects()
Gets all injected-objects.
|
int |
getOrder() |
void |
postProcessMergedBeanDefinition(org.springframework.beans.factory.support.RootBeanDefinition beanDefinition,
Class<?> beanType,
String beanName) |
org.springframework.beans.PropertyValues |
postProcessPropertyValues(org.springframework.beans.PropertyValues pvs,
PropertyDescriptor[] pds,
Object bean,
String beanName) |
void |
setBeanClassLoader(ClassLoader classLoader) |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setEnvironment(org.springframework.core.env.Environment environment) |
void |
setOrder(int order) |
determineCandidateConstructors, getEarlyBeanReference, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, predictBeanTypepublic AbstractAnnotationBeanPostProcessor(Class<? extends Annotation>... annotationTypes)
annotationTypes - the multiple types of annotations@Deprecated public final Class<? extends Annotation> getAnnotationType()
getAnnotationTypes()protected final Class<? extends Annotation>[] getAnnotationTypes()
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory 在接口中 org.springframework.beans.factory.BeanFactoryAwareorg.springframework.beans.BeansExceptionpublic org.springframework.beans.PropertyValues postProcessPropertyValues(org.springframework.beans.PropertyValues pvs,
PropertyDescriptor[] pds,
Object bean,
String beanName)
throws org.springframework.beans.factory.BeanCreationException
postProcessPropertyValues 在接口中 org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorpostProcessPropertyValues 在类中 org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapterorg.springframework.beans.factory.BeanCreationExceptionpublic void postProcessMergedBeanDefinition(org.springframework.beans.factory.support.RootBeanDefinition beanDefinition,
Class<?> beanType,
String beanName)
postProcessMergedBeanDefinition 在接口中 org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessorpublic int getOrder()
getOrder 在接口中 org.springframework.core.Orderedpublic void setOrder(int order)
public void destroy()
throws Exception
destroy 在接口中 org.springframework.beans.factory.DisposableBeanExceptionpublic void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader 在接口中 org.springframework.beans.factory.BeanClassLoaderAwarepublic void setEnvironment(org.springframework.core.env.Environment environment)
setEnvironment 在接口中 org.springframework.context.EnvironmentAwareprotected org.springframework.core.env.Environment getEnvironment()
protected ClassLoader getClassLoader()
protected org.springframework.beans.factory.config.ConfigurableListableBeanFactory getBeanFactory()
protected Collection<Object> getInjectedObjects()
Collectionprotected Object getInjectedObject(org.springframework.core.annotation.AnnotationAttributes attributes, Object bean, String beanName, Class<?> injectedType, org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement injectedElement) throws Exception
annotation attributes and Bean Classattributes - the annotation attributesbean - Current bean that will be injectedbeanName - Current bean name that will be injectedinjectedType - the type of injected-objectinjectedElement - InjectionMetadata.InjectedElementException - If getting is failedprotected abstract Object doGetInjectedBean(org.springframework.core.annotation.AnnotationAttributes attributes, Object bean, String beanName, Class<?> injectedType, org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement injectedElement) throws Exception
attributes - the annotation attributesbean - Current bean that will be injectedbeanName - Current bean name that will be injectedinjectedType - the type of injected-objectinjectedElement - InjectionMetadata.InjectedElementException - If resolving an injected object is failed.protected abstract String buildInjectedObjectCacheKey(org.springframework.core.annotation.AnnotationAttributes attributes, Object bean, String beanName, Class<?> injectedType, org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement injectedElement)
attributes - the annotation attributesbean - Current bean that will be injectedbeanName - Current bean name that will be injectedinjectedType - the type of injected-objectinjectedElement - InjectionMetadata.InjectedElementprotected Map<org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement,Object> getInjectedFieldObjectsMap()
Map in injected field.MapCopyright © 2019. All rights reserved.