类 JsrAutowiredAnnotationBeanPostProcessor

  • 所有已实现的接口:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor, org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor, org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor, org.springframework.core.Ordered, org.springframework.core.PriorityOrdered

    public class JsrAutowiredAnnotationBeanPostProcessor
    extends org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter

    This class overrides methods in the copied SpringAutowiredAnnotationBeanPostProcessor class to check for the BatchProperty annotation before processing injection annotations. If the annotation is found, further injection processing for the field is skipped.

    • 字段概要

      字段 
      修饰符和类型字段说明
      protected org.apache.commons.logging.Loglogger 
      • 从接口继承的字段 org.springframework.core.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      protected org.springframework.beans.factory.annotation.InjectionMetadatabuildAutowiringMetadata​(java.lang.Class<?> clazz) 
      java.lang.reflect.Constructor<?>[]determineCandidateConstructors​(java.lang.Class<?> beanClass, java.lang.String beanName) 
      protected booleandetermineRequiredStatus​(java.lang.annotation.Annotation annotation)
      Determine if the annotated field or method requires its dependency.
      protected <T> java.util.Map<java.lang.String,​T>findAutowireCandidates​(java.lang.Class<T> type)
      Obtain all beans of the given type as autowire candidates.
      protected java.lang.annotation.AnnotationfindAutowiredAnnotation​(java.lang.reflect.AccessibleObject ao) 
      protected org.springframework.beans.factory.annotation.InjectionMetadatafindAutowiringMetadata​(java.lang.Class<?> clazz) 
      intgetOrder() 
      voidpostProcessMergedBeanDefinition​(org.springframework.beans.factory.support.RootBeanDefinition beanDefinition, java.lang.Class<?> beanType, java.lang.String beanName) 
      org.springframework.beans.PropertyValuespostProcessPropertyValues​(org.springframework.beans.PropertyValues pvs, java.beans.PropertyDescriptor[] pds, java.lang.Object bean, java.lang.String beanName) 
      voidprocessInjection​(java.lang.Object bean)
      'Native' processing method for direct calls with an arbitrary target instance, resolving all of its fields and methods which are annotated with @Autowired.
      voidsetAutowiredAnnotationType​(java.lang.Class<? extends java.lang.annotation.Annotation> autowiredAnnotationType)
      Set the 'autowired' annotation type, to be used on constructors, fields, setter methods and arbitrary config methods.
      voidsetAutowiredAnnotationTypes​(java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> autowiredAnnotationTypes)
      Set the 'autowired' annotation types, to be used on constructors, fields, setter methods and arbitrary config methods.
      voidsetBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory) 
      voidsetOrder​(int order) 
      voidsetRequiredParameterName​(java.lang.String requiredParameterName)
      Set the name of a parameter of the annotation that specifies whether it is required.
      voidsetRequiredParameterValue​(boolean requiredParameterValue)
      Set the boolean value that marks a dependency as required
      • 从类继承的方法 org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter

        getEarlyBeanReference, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, postProcessProperties, predictBeanType
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • 从接口继承的方法 org.springframework.beans.factory.config.BeanPostProcessor

        postProcessAfterInitialization, postProcessBeforeInitialization
      • 从接口继承的方法 org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor

        resetBeanDefinition
    • 字段详细资料

      • logger

        protected final org.apache.commons.logging.Log logger
    • 方法详细资料

      • findAutowiringMetadata

        protected org.springframework.beans.factory.annotation.InjectionMetadata findAutowiringMetadata​(java.lang.Class<?> clazz)
      • findAutowiredAnnotation

        protected java.lang.annotation.Annotation findAutowiredAnnotation​(java.lang.reflect.AccessibleObject ao)
      • setAutowiredAnnotationType

        public void setAutowiredAnnotationType​(java.lang.Class<? extends java.lang.annotation.Annotation> autowiredAnnotationType)
        Set the 'autowired' annotation type, to be used on constructors, fields, setter methods and arbitrary config methods.

        The default autowired annotation type is the Spring-provided Autowired annotation, as well as Value.

        This setter property exists so that developers can provide their own (non-Spring-specific) annotation type to indicate that a member is supposed to be autowired.

        参数:
        autowiredAnnotationType - type to be used by constructors, fields and methods.
      • setAutowiredAnnotationTypes

        public void setAutowiredAnnotationTypes​(java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> autowiredAnnotationTypes)
        Set the 'autowired' annotation types, to be used on constructors, fields, setter methods and arbitrary config methods.

        The default autowired annotation type is the Spring-provided Autowired annotation, as well as Value.

        This setter property exists so that developers can provide their own (non-Spring-specific) annotation types to indicate that a member is supposed to be autowired.

        参数:
        autowiredAnnotationTypes - set of types to be used by constructors, fields and methods.
      • setRequiredParameterName

        public void setRequiredParameterName​(java.lang.String requiredParameterName)
        Set the name of a parameter of the annotation that specifies whether it is required.
        参数:
        requiredParameterName - the name of the parameter.
        另请参阅:
        setRequiredParameterValue(boolean)
      • setRequiredParameterValue

        public void setRequiredParameterValue​(boolean requiredParameterValue)
        Set the boolean value that marks a dependency as required

        For example if using 'required=true' (the default), this value should be true; but if using 'optional=false', this value should be false.

        参数:
        requiredParameterValue - true if dependency is required.
        另请参阅:
        setRequiredParameterName(String)
      • setOrder

        public void setOrder​(int order)
      • getOrder

        public int getOrder()
        指定者:
        getOrder 在接口中 org.springframework.core.Ordered
      • setBeanFactory

        public void setBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory)
                            throws org.springframework.beans.BeansException
        指定者:
        setBeanFactory 在接口中 org.springframework.beans.factory.BeanFactoryAware
        抛出:
        org.springframework.beans.BeansException
      • postProcessMergedBeanDefinition

        public void postProcessMergedBeanDefinition​(org.springframework.beans.factory.support.RootBeanDefinition beanDefinition,
                                                    java.lang.Class<?> beanType,
                                                    java.lang.String beanName)
        指定者:
        postProcessMergedBeanDefinition 在接口中 org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor
      • determineCandidateConstructors

        public java.lang.reflect.Constructor<?>[] determineCandidateConstructors​(java.lang.Class<?> beanClass,
                                                                                 java.lang.String beanName)
                                                                          throws org.springframework.beans.BeansException
        指定者:
        determineCandidateConstructors 在接口中 org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor
        覆盖:
        determineCandidateConstructors 在类中 org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
        抛出:
        org.springframework.beans.BeansException
      • postProcessPropertyValues

        public org.springframework.beans.PropertyValues postProcessPropertyValues​(org.springframework.beans.PropertyValues pvs,
                                                                                  java.beans.PropertyDescriptor[] pds,
                                                                                  java.lang.Object bean,
                                                                                  java.lang.String beanName)
                                                                           throws org.springframework.beans.BeansException
        指定者:
        postProcessPropertyValues 在接口中 org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor
        覆盖:
        postProcessPropertyValues 在类中 org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
        抛出:
        org.springframework.beans.BeansException
      • processInjection

        public void processInjection​(java.lang.Object bean)
                              throws org.springframework.beans.BeansException
        'Native' processing method for direct calls with an arbitrary target instance, resolving all of its fields and methods which are annotated with @Autowired.
        参数:
        bean - the target instance to process
        抛出:
        org.springframework.beans.BeansException - if autowiring failed
      • buildAutowiringMetadata

        protected org.springframework.beans.factory.annotation.InjectionMetadata buildAutowiringMetadata​(java.lang.Class<?> clazz)
      • findAutowireCandidates

        protected <T> java.util.Map<java.lang.String,​T> findAutowireCandidates​(java.lang.Class<T> type)
                                                                              throws org.springframework.beans.BeansException
        Obtain all beans of the given type as autowire candidates.
        类型参数:
        T - the type of the bean.
        参数:
        type - the type of the bean.
        返回:
        the target beans, or an empty Collection if no bean of this type is found
        抛出:
        org.springframework.beans.BeansException - if bean retrieval failed
      • determineRequiredStatus

        protected boolean determineRequiredStatus​(java.lang.annotation.Annotation annotation)
        Determine if the annotated field or method requires its dependency.

        A 'required' dependency means that autowiring should fail when no beans are found. Otherwise, the autowiring process will simply bypass the field or method when no beans are found.

        参数:
        annotation - the Autowired annotation
        返回:
        whether the annotation indicates that a dependency is required