类 AnnotatedPropertySourceLoader<A extends java.lang.annotation.Annotation>

  • 类型参数:
    A - The type of Annotation
    所有已实现的接口:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.context.annotation.ImportSelector, org.springframework.context.EnvironmentAware, org.springframework.context.ResourceLoaderAware
    直接已知子类:
    PropertySourceExtensionLoader

    public abstract class AnnotatedPropertySourceLoader<A extends java.lang.annotation.Annotation>
    extends BeanCapableImportCandidate
    implements org.springframework.context.annotation.ImportSelector
    Abstract ImportSelector class to load the PropertySource when the configuration annotated the specified annotation
    从以下版本开始:
    1.0.0
    作者:
    Mercy
    另请参阅:
    ResourcePropertySourceLoader, PropertySourceExtensionLoader, ImportSelector
    • 字段详细资料

      • NAME_ATTRIBUTE_NAME

        protected static final java.lang.String NAME_ATTRIBUTE_NAME
        另请参阅:
        常量字段值
      • logger

        protected final org.slf4j.Logger logger
    • 构造器详细资料

      • AnnotatedPropertySourceLoader

        public AnnotatedPropertySourceLoader()
    • 方法详细资料

      • resolveAnnotationType

        protected java.lang.Class<A> resolveAnnotationType()
      • selectImports

        public final java.lang.String[] selectImports​(org.springframework.core.type.AnnotationMetadata metadata)
        指定者:
        selectImports 在接口中 org.springframework.context.annotation.ImportSelector
      • resolvePropertySourceName

        @NonNull
        protected final java.lang.String resolvePropertySourceName​(org.springframework.core.annotation.AnnotationAttributes attributes,
                                                                   org.springframework.core.type.AnnotationMetadata metadata)
        Resolve the name of PropertySource
        参数:
        attributes - AnnotationAttributes
        metadata - AnnotationMetadata
        返回:
        non-null
      • buildPropertySourceName

        @Nullable
        protected java.lang.String buildPropertySourceName​(org.springframework.core.annotation.AnnotationAttributes attributes,
                                                           org.springframework.core.type.AnnotationMetadata metadata)
        Build the name of PropertySource
        参数:
        attributes - AnnotationAttributes
        metadata - AnnotationMetadata
        返回:
        the attribute value of annotation if the "name" attribute present, or null
      • buildDefaultPropertySourceName

        @NonNull
        protected java.lang.String buildDefaultPropertySourceName​(org.springframework.core.annotation.AnnotationAttributes attributes,
                                                                  org.springframework.core.type.AnnotationMetadata metadata)
        Build the default name of PropertySource
        参数:
        attributes - AnnotationAttributes
        metadata - AnnotationMetadata
        返回:
        non-null
      • loadPropertySource

        @Nullable
        protected abstract void loadPropertySource​(org.springframework.core.annotation.AnnotationAttributes attributes,
                                                   org.springframework.core.type.AnnotationMetadata metadata,
                                                   java.lang.String propertySourceName,
                                                   org.springframework.core.env.MutablePropertySources propertySources)
                                            throws java.lang.Throwable
        Load the PropertySource
        参数:
        attributes - AnnotationAttributes
        metadata - AnnotationMetadata
        propertySourceName - the name of PropertySource
        propertySources - MutablePropertySources to be added
        抛出:
        java.lang.Throwable - the failure of the loading
      • getAnnotationType

        @NonNull
        public final java.lang.Class<A> getAnnotationType()
        The annotation type
        返回:
        non-null
      • getPropertySourceName

        protected java.lang.String getPropertySourceName()