Class ResourcePropertySourceLoader
- java.lang.Object
-
- io.microsphere.spring.context.annotation.BeanCapableImportCandidate
-
- io.microsphere.spring.config.context.annotation.AnnotatedPropertySourceLoader<A>
-
- io.microsphere.spring.config.context.annotation.PropertySourceExtensionLoader<ResourcePropertySource,PropertySourceExtensionAttributes<ResourcePropertySource>>
-
- io.microsphere.spring.config.context.annotation.ResourcePropertySourceLoader
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.annotation.ImportSelector,org.springframework.context.ApplicationContextAware,org.springframework.context.EnvironmentAware,org.springframework.context.ResourceLoaderAware
public class ResourcePropertySourceLoader extends PropertySourceExtensionLoader<ResourcePropertySource,PropertySourceExtensionAttributes<ResourcePropertySource>> implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.DisposableBean
ThePropertySourceExtensionLoaderClass forResourcePropertySource- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
ResourcePropertySource,PropertySourceExtensionAttributes
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.microsphere.spring.config.context.annotation.PropertySourceExtensionLoader
PropertySourceExtensionLoader.PropertySourceResource, PropertySourceExtensionLoader.ResourcePropertySourcesRefresher
-
-
Field Summary
-
Fields inherited from class io.microsphere.spring.config.context.annotation.AnnotatedPropertySourceLoader
logger, NAME_ATTRIBUTE_NAME
-
Fields inherited from class io.microsphere.spring.context.annotation.BeanCapableImportCandidate
beanFactory, classLoader, environment, resourceLoader
-
-
Constructor Summary
Constructors Constructor Description ResourcePropertySourceLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()protected voidconfigureResourcePropertySourcesRefresher(PropertySourceExtensionAttributes<ResourcePropertySource> extensionAttributes, java.util.List<PropertySourceExtensionLoader.PropertySourceResource> propertySourceResources, org.springframework.core.env.CompositePropertySource propertySource, PropertySourceExtensionLoader.ResourcePropertySourcesRefresher refresher)Configure thePropertySourceExtensionLoader.ResourcePropertySourcesRefresherofPropertySourceResourceswhenPropertySourceExtension.autoRefreshed()istruevoiddestroy()booleanisResourcePattern(java.lang.String resourceValue)Test the resource value is pattern or notprotected org.springframework.core.io.Resource[]resolveResources(PropertySourceExtensionAttributes<ResourcePropertySource> extensionAttributes, java.lang.String propertySourceName, java.lang.String resourceValue)Resolve the given resource value(s) to bePropertySourceExtensionLoader.PropertySourceResourcearray.-
Methods inherited from class io.microsphere.spring.config.context.annotation.PropertySourceExtensionLoader
addPropertySource, buildExtensionAttributes, createInstance, createPropertySourceFactory, createResourceComparator, createResourcePropertySource, createResourcePropertySourceName, getExtensionAttributesType, loadPropertySource, loadPropertySource, resolveExtensionAttributesType, resolvePropertySourceResources, setApplicationContext
-
Methods inherited from class io.microsphere.spring.config.context.annotation.AnnotatedPropertySourceLoader
buildDefaultPropertySourceName, buildPropertySourceName, getAnnotationType, getPropertySourceName, resolveAnnotationType, resolvePropertySourceName, selectImports
-
Methods inherited from class io.microsphere.spring.context.annotation.BeanCapableImportCandidate
getBeanFactory, getClassLoader, getEnvironment, getResourceLoader, setBeanClassLoader, setBeanFactory, setEnvironment, setResourceLoader
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.beans.factory.BeanClassLoaderAware
setBeanClassLoader
-
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
resolveResources
protected org.springframework.core.io.Resource[] resolveResources(PropertySourceExtensionAttributes<ResourcePropertySource> extensionAttributes, java.lang.String propertySourceName, java.lang.String resourceValue) throws java.lang.Throwable
Description copied from class:PropertySourceExtensionLoaderResolve the given resource value(s) to bePropertySourceExtensionLoader.PropertySourceResourcearray.- Specified by:
resolveResourcesin classPropertySourceExtensionLoader<ResourcePropertySource,PropertySourceExtensionAttributes<ResourcePropertySource>>- Parameters:
extensionAttributes-PropertySourceExtensionLoaderpropertySourceName-PropertySourceExtension.name()resourceValue- the resource value to resolve- Returns:
- nullable
- Throws:
java.lang.Throwable
-
isResourcePattern
public boolean isResourcePattern(java.lang.String resourceValue)
Description copied from class:PropertySourceExtensionLoaderTest the resource value is pattern or not- Specified by:
isResourcePatternin classPropertySourceExtensionLoader<ResourcePropertySource,PropertySourceExtensionAttributes<ResourcePropertySource>>- Parameters:
resourceValue- theStringvalue presenting resource- Returns:
trueifresourceValueis a pattern value
-
configureResourcePropertySourcesRefresher
protected void configureResourcePropertySourcesRefresher(PropertySourceExtensionAttributes<ResourcePropertySource> extensionAttributes, java.util.List<PropertySourceExtensionLoader.PropertySourceResource> propertySourceResources, org.springframework.core.env.CompositePropertySource propertySource, PropertySourceExtensionLoader.ResourcePropertySourcesRefresher refresher) throws java.lang.Throwable
Description copied from class:PropertySourceExtensionLoaderConfigure thePropertySourceExtensionLoader.ResourcePropertySourcesRefresherofPropertySourceResourceswhenPropertySourceExtension.autoRefreshed()istrue- Overrides:
configureResourcePropertySourcesRefresherin classPropertySourceExtensionLoader<ResourcePropertySource,PropertySourceExtensionAttributes<ResourcePropertySource>>- Parameters:
extensionAttributes- theannotation attributesofPropertySourceExtensionpropertySourceResources- The sorted list of the resolvedresourcespropertySource- Theproperty sourceof current loader to be added into the Spring'sproperty sourcesrefresher- The Refresher ofPropertySources'Resource- Throws:
java.lang.Throwable- any error
-
destroy
public void destroy() throws java.lang.Exception- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
java.lang.Exception
-
-