public class NacosValueAnnotationBeanPostProcessor extends AbstractAnnotationBeanPostProcessor implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.context.EnvironmentAware, org.springframework.context.ApplicationListener<NacosConfigReceivedEvent>
| 限定符和类型 | 类和说明 |
|---|---|
private static class |
NacosValueAnnotationBeanPostProcessor.NacosValueTarget |
AbstractAnnotationBeanPostProcessor.AnnotatedFieldElement| 限定符和类型 | 字段和说明 |
|---|---|
static String |
BEAN_NAME
The name of
NacosValueAnnotationBeanPostProcessor bean. |
private org.springframework.beans.factory.config.ConfigurableListableBeanFactory |
beanFactory |
private org.springframework.core.env.Environment |
environment |
private org.slf4j.Logger |
logger |
private static String |
PLACEHOLDER_PREFIX |
private static String |
PLACEHOLDER_SUFFIX |
private Map<String,List<NacosValueAnnotationBeanPostProcessor.NacosValueTarget>> |
placeholderNacosValueTargetMap
placeholder, nacosValueTarget.
|
private static String |
VALUE_SEPARATOR |
| 构造器和说明 |
|---|
NacosValueAnnotationBeanPostProcessor() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected String |
buildInjectedObjectCacheKey(org.springframework.core.annotation.AnnotationAttributes attributes,
Object bean,
String beanName,
Class<?> injectedType,
org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement injectedElement) |
private Object |
convertIfNecessary(Field field,
Object value) |
private Object |
convertIfNecessary(Method method,
Object value) |
protected Object |
doGetInjectedBean(org.springframework.core.annotation.AnnotationAttributes attributes,
Object bean,
String beanName,
Class<?> injectedType,
org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement injectedElement) |
private void |
doWithAnnotation(String beanName,
Object bean,
com.alibaba.nacos.api.config.annotation.NacosValue annotation,
int modifiers,
Method method,
Field field) |
private void |
doWithFields(Object bean,
String beanName) |
private void |
doWithMethods(Object bean,
String beanName) |
void |
onApplicationEvent(NacosConfigReceivedEvent event) |
Object |
postProcessBeforeInitialization(Object bean,
String beanName) |
private <K,V> void |
put2ListMap(Map<K,List<V>> map,
K key,
V value) |
private String |
resolvePlaceholder(String placeholder) |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setEnvironment(org.springframework.core.env.Environment environment) |
private void |
setField(NacosValueAnnotationBeanPostProcessor.NacosValueTarget nacosValueTarget,
String propertyValue) |
private void |
setMethod(NacosValueAnnotationBeanPostProcessor.NacosValueTarget nacosValueTarget,
String propertyValue) |
destroy, doGetAnnotationAttributes, getAnnotationType, getAnnotationTypes, getBeanFactory, getClassLoader, getEnvironment, getInjectedFieldObjectsMap, getInjectedMethodObjectsMap, getInjectedObject, getInjectedObjects, getOrder, postProcessMergedBeanDefinition, postProcessPropertyValues, setBeanClassLoader, setClassValuesAsString, setIgnoreDefaultValue, setNestedAnnotationsAsMap, setOrder, setTryMergedAnnotationdetermineCandidateConstructors, getEarlyBeanReference, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInstantiation, postProcessProperties, predictBeanTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final String BEAN_NAME
NacosValueAnnotationBeanPostProcessor bean.private final org.slf4j.Logger logger
private Map<String,List<NacosValueAnnotationBeanPostProcessor.NacosValueTarget>> placeholderNacosValueTargetMap
private org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory
private org.springframework.core.env.Environment environment
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory 在接口中 org.springframework.beans.factory.BeanFactoryAwaresetBeanFactory 在类中 AbstractAnnotationBeanPostProcessororg.springframework.beans.BeansExceptionpublic void setEnvironment(org.springframework.core.env.Environment environment)
setEnvironment 在接口中 org.springframework.context.EnvironmentAwaresetEnvironment 在类中 AbstractAnnotationBeanPostProcessorpublic Object postProcessBeforeInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessBeforeInitialization 在接口中 org.springframework.beans.factory.config.BeanPostProcessorpostProcessBeforeInitialization 在类中 org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapterorg.springframework.beans.BeansExceptionpublic void onApplicationEvent(NacosConfigReceivedEvent event)
onApplicationEvent 在接口中 org.springframework.context.ApplicationListener<NacosConfigReceivedEvent>protected Object doGetInjectedBean(org.springframework.core.annotation.AnnotationAttributes attributes, Object bean, String beanName, Class<?> injectedType, org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement injectedElement) throws Exception
protected String buildInjectedObjectCacheKey(org.springframework.core.annotation.AnnotationAttributes attributes, Object bean, String beanName, Class<?> injectedType, org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement injectedElement)
private void doWithAnnotation(String beanName, Object bean, com.alibaba.nacos.api.config.annotation.NacosValue annotation, int modifiers, Method method, Field field)
private void setMethod(NacosValueAnnotationBeanPostProcessor.NacosValueTarget nacosValueTarget, String propertyValue)
private void setField(NacosValueAnnotationBeanPostProcessor.NacosValueTarget nacosValueTarget, String propertyValue)
Copyright © 2021 Zodiac. All rights reserved.