-
Notifications
You must be signed in to change notification settings - Fork 39
io microsphere spring config context annotation PropertySourceExtensionAttributes
Type: Class | Module: microsphere-spring-context | Package: io.microsphere.spring.config.context.annotation | Since: 1.0.0
AnnotationAttributes for the annotation meta-annotated PropertySourceExtension
public class PropertySourceExtensionAttributes<A extends Annotation> extends ResolvablePlaceholderAnnotationAttributes<A>Author: Mercy
-
Introduced in:
1.0.0 -
Current Project Version:
0.2.27-SNAPSHOT
This component is tested and compatible with the following Java versions:
| Java Version | Status |
|---|---|
| Java 17 | ✅ Compatible |
| Java 21 | ✅ Compatible |
| Java 25 | ✅ Compatible |
AnnotationAttributes attrs = getAnnotationAttributes(MyConfig.class, ResourcePropertySource.class, environment, false);
PropertySourceExtensionAttributes<ResourcePropertySource> extensionAttrs =
new PropertySourceExtensionAttributes<>(attrs, ResourcePropertySource.class, environment);// Given @ResourcePropertySource(name = "test-property-source", value = "classpath*:/META-INF/test/*.properties")
PropertySourceExtensionAttributes<ResourcePropertySource> attributes = ...;
String name = attributes.getName(); // "test-property-source"// Given @ResourcePropertySource(value = "classpath*:/META-INF/test/*.properties", autoRefreshed = true)
PropertySourceExtensionAttributes<ResourcePropertySource> attributes = ...;
boolean autoRefreshed = attributes.isAutoRefreshed(); // true// Given @ResourcePropertySource(value = "classpath*:/META-INF/test/*.properties", first = true)
PropertySourceExtensionAttributes<ResourcePropertySource> attributes = ...;
boolean first = attributes.isFirstPropertySource(); // true// Given @ResourcePropertySource(value = "classpath*:/META-INF/test/*.properties",
// before = "systemEnvironment")
PropertySourceExtensionAttributes<ResourcePropertySource> attributes = ...;
String before = attributes.getBeforePropertySourceName(); // "systemEnvironment"// Given @ResourcePropertySource(value = "classpath*:/META-INF/test/*.properties",
// after = "systemProperties")
PropertySourceExtensionAttributes<ResourcePropertySource> attributes = ...;
String after = attributes.getAfterPropertySourceName(); // "systemProperties"PropertySourceExtensionAttributes<ResourcePropertySource> attributes = ...;
Class<ResourcePropertySource> type = attributes.getAnnotationType();
// type == ResourcePropertySource.class// Given @ResourcePropertySource(value = {"classpath*:/META-INF/test/*.properties"})
PropertySourceExtensionAttributes<ResourcePropertySource> attributes = ...;
String[] values = attributes.getValue(); // ["classpath*:/META-INF/test/*.properties"]PropertySourceExtensionAttributes<ResourcePropertySource> attributes = ...;
Class<? extends Comparator<Resource>> comparatorClass = attributes.getResourceComparatorClass();
// defaults to DefaultResourceComparator.class// Given @ResourcePropertySource(value = "classpath*:/not-found.properties", ignoreResourceNotFound = true)
PropertySourceExtensionAttributes<ResourcePropertySource> attributes = ...;
boolean ignore = attributes.isIgnoreResourceNotFound(); // true// Given @ResourcePropertySource(value = "classpath*:/META-INF/test/*.properties", encoding = "UTF-8")
PropertySourceExtensionAttributes<ResourcePropertySource> attributes = ...;
String encoding = attributes.getEncoding(); // "UTF-8"Add the following dependency to your pom.xml:
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-context</artifactId>
<version>${microsphere-spring.version}</version>
</dependency>Tip: Use the BOM (
microsphere-spring-dependencies) for consistent version management. See the Getting Started guide.
import io.microsphere.spring.config.context.annotation.PropertySourceExtensionAttributes;| Method | Description |
|---|---|
getName |
Constructs a new PropertySourceExtensionAttributes instance from the given annotation attributes map, |
isAutoRefreshed |
Returns whether the property source should be automatically refreshed when the underlying |
isFirstPropertySource |
Returns whether this property source should be placed first in the |
getBeforePropertySourceName |
Returns the name of the property source before which this property source should be inserted. |
getAfterPropertySourceName |
Returns the name of the property source after which this property source should be inserted. |
getAnnotationType |
Returns the annotation type associated with these extension attributes. |
getValue |
Returns the resource location values specified by the value attribute of the annotation. |
isIgnoreResourceNotFound |
Returns the Comparator class used to sort the resolved Resource instances |
getEncoding |
Returns the character encoding to use when reading the property source resources. |
public final String getName()Constructs a new PropertySourceExtensionAttributes instance from the given annotation attributes map,
annotation type, and an optional PropertyResolver for resolving placeholders.
`AnnotationAttributes attrs = getAnnotationAttributes(MyConfig.class, ResourcePropertySource.class, environment, false);
PropertySourceExtensionAttributes extensionAttrs =
new PropertySourceExtensionAttributes<>(attrs, ResourcePropertySource.class, environment);
`
public final boolean isAutoRefreshed()Returns whether the property source should be automatically refreshed when the underlying resource changes.
`// Given @ResourcePropertySource(value = "classpath*:/META-INF/test/*.properties", autoRefreshed = true) PropertySourceExtensionAttributes attributes = ...; boolean autoRefreshed = attributes.isAutoRefreshed(); // true `
public final boolean isFirstPropertySource()Returns whether this property source should be placed first in the
org.springframework.core.env.MutablePropertySources list.
`// Given @ResourcePropertySource(value = "classpath*:/META-INF/test/*.properties", first = true) PropertySourceExtensionAttributes attributes = ...; boolean first = attributes.isFirstPropertySource(); // true `
public final String getBeforePropertySourceName()Returns the name of the property source before which this property source should be inserted.
`// Given @ResourcePropertySource(value = "classpath*:/META-INF/test/*.properties", // before = "systemEnvironment") PropertySourceExtensionAttributes attributes = ...; String before = attributes.getBeforePropertySourceName(); // "systemEnvironment" `
public final String getAfterPropertySourceName()Returns the name of the property source after which this property source should be inserted.
`// Given @ResourcePropertySource(value = "classpath*:/META-INF/test/*.properties", // after = "systemProperties") PropertySourceExtensionAttributes attributes = ...; String after = attributes.getAfterPropertySourceName(); // "systemProperties" `
public final Class<A> getAnnotationType()Returns the annotation type associated with these extension attributes.
`PropertySourceExtensionAttributes attributes = ...; Class type = attributes.getAnnotationType(); // type == ResourcePropertySource.class `
public final String[] getValue()Returns the resource location values specified by the value attribute of the annotation.
These are the resource paths from which properties will be loaded.
`// Given @ResourcePropertySource(value = {"classpath*:/META-INF/test/*.properties"`)
PropertySourceExtensionAttributes attributes = ...;
String[] values = attributes.getValue(); // ["classpath*:/META-INF/test/*.properties"]
}
public final boolean isIgnoreResourceNotFound()Returns the Comparator class used to sort the resolved Resource instances
before loading them into the property source.
`PropertySourceExtensionAttributes attributes = ...; Class> comparatorClass = attributes.getResourceComparatorClass(); // defaults to DefaultResourceComparator.class `
public final String getEncoding()Returns the character encoding to use when reading the property source resources.
`// Given @ResourcePropertySource(value = "classpath*:/META-INF/test/*.properties", encoding = "UTF-8") PropertySourceExtensionAttributes attributes = ...; String encoding = attributes.getEncoding(); // "UTF-8" `
PropertySourceExtensionResolvablePlaceholderAnnotationAttributes
This documentation was auto-generated from the source code of microsphere-spring.
spring-context
- AbstractInjectionPointDependencyResolver
- AbstractSmartLifecycle
- AbstractSpringResourceURLConnection
- AnnotatedBeanCapableImportBeanDefinitionRegistrar
- AnnotatedBeanCapableImportCandidate
- AnnotatedBeanCapableImportSelector
- AnnotatedBeanDefinitionRegistryUtils
- AnnotatedInjectionBeanPostProcessor
- AnnotatedInjectionPointDependencyResolver
- AnnotatedPropertySourceLoader
- AnnotationBeanDefinitionRegistryPostProcessor
- AnnotationUtils
- ApplicationContextUtils
- ApplicationEventInterceptor
- ApplicationEventInterceptorChain
- ApplicationListenerInterceptor
- ApplicationListenerInterceptorChain
- AutoRegistrationBean
- AutoRegistrationBeanRegistrar
- AutowireCandidateResolvingListener
- AutowiredInjectionPointDependencyResolver
- BeanCapableImportCandidate
- BeanDefinitionUtils
- BeanDependencyResolver
- BeanFactoryListener
- BeanFactoryListenerAdapter
- BeanFactoryListeners
- BeanFactoryUtils
- BeanListener
- BeanListenerAdapter
- BeanListeners
- BeanMethodInjectionPointDependencyResolver
- BeanPropertyChangedEvent
- BeanRegistrar
- BeanSource
- BeanTimeStatistics
- BeanUtils
- CollectingConfigurationPropertyListener
- CompositeAutowireCandidateResolvingListener
- ConfigurationBeanAliasGenerator
- ConfigurationBeanBinder
- ConfigurationBeanBindingPostProcessor
- ConfigurationBeanBindingRegistrar
- ConfigurationBeanBindingsRegister
- ConfigurationBeanCustomizer
- ConfigurationPropertyOverrideAnnotationAttributesStrategy
- ConfigurationPropertyRepository
- ConstructionInjectionPointDependencyResolver
- ConversionServiceResolver
- ConversionServiceUtils
- DefaultApplicationEventInterceptorChain
- DefaultApplicationListenerInterceptorChain
- DefaultBeanDependencyResolver
- DefaultConfigurationBeanAliasGenerator
- DefaultConfigurationBeanBinder
- DefaultPropertiesPropertySource
- DefaultPropertiesPropertySourceLoader
- DefaultPropertiesPropertySources
- DefaultPropertiesPropertySourcesLoader
- DefaultResourceComparator
- DelegatingFactoryBean
- Dependency
- DependencyAnalysisBeanFactoryListener
- DependencyTreeWalker
- EnableAutoRegistrationBean
- EnableConfigurationBeanBinding
- EnableConfigurationBeanBindings
- EnableEventExtension
- EnableSpringConverterAdapter
- EnableSpringConverterAdapterRegistrar
- EnableTTLCaching
- EnvironmentListener
- EnvironmentUtils
- EventExtensionAttributes
- EventExtensionRegistrar
- EventPublishingBeanAfterProcessor
- EventPublishingBeanBeforeProcessor
- EventPublishingBeanInitializer
- ExposingClassPathBeanDefinitionScanner
- FilterMode
- GenericAnnotationAttributes
- GenericApplicationListenerAdapter
- GenericBeanNameGenerator
- GenericBeanPostProcessorAdapter
- HyphenAliasGenerator
- ImmutableMapPropertySource
- ImportOptional
- ImportOptionalSelector
- InjectionPointDependencyResolver
- InjectionPointDependencyResolvers
- InterceptingApplicationEventMulticaster
- InterceptingApplicationEventMulticasterProxy
- InterceptingApplicationListener
- JavaBeansPropertyChangeListenerAdapter
- JoinAliasGenerator
- JsonPropertySource
- JsonPropertySourceFactory
- ListenableAutowireCandidateResolver
- ListenableAutowireCandidateResolverInitializer
- ListenableConfigurableEnvironment
- ListenableConfigurableEnvironmentInitializer
- LoggingAutowireCandidateResolvingListener
- LoggingBeanFactoryListener
- LoggingBeanListener
- LoggingEnvironmentListener
- LoggingSmartLifecycle
- MethodParameterUtils
- MimeTypeUtils
- NamedBeanHolderComparator
- OnceApplicationContextEventListener
- OverrideAnnotationAttributes
- OverrideAnnotationAttributesStrategy
- ParallelPreInstantiationSingletonsBeanFactoryListener
- ProfileListener
- PropertiesUtils
- PropertyConstants
- PropertyResolverListener
- PropertyResolverUtils
- PropertySourceChangedEvent
- PropertySourceExtension
- PropertySourceExtensionAttributes
- PropertySourceExtensionLoader
- PropertySourcesChangedEvent
- PropertySourcesUtils
- PropertyValuesUtils
- ResolvableDependencyTypeFilter
- ResolvablePlaceholderAnnotationAttributes
- ResourceInjectionPointDependencyResolver
- ResourceLoaderUtils
- ResourcePropertySource
- ResourcePropertySourceLoader
- ResourcePropertySources
- ResourcePropertySourcesLoader
- ResourceUtils
- ResourceYamlProcessor
- SpringConverterAdapter
- SpringDelegatingBeanProtocolURLConnectionFactory
- SpringEnvironmentURLConnectionFactory
- SpringFactoriesLoaderUtils
- SpringProfilesURLConnectionAdapter
- SpringPropertySourcesURLConnectionAdapter
- SpringProtocolURLStreamHandler
- SpringResourceURLConnection
- SpringResourceURLConnectionAdapter
- SpringResourceURLConnectionFactory
- SpringSubProtocolURLConnectionFactory
- SpringVersion
- SpringVersionUtils
- TTLCachePut
- TTLCacheResolver
- TTLCacheable
- TTLCachingConfiguration
- TTLContext
- UnderScoreJoinAliasGenerator
- YamlPropertySource
- YamlPropertySourceFactory
spring-guice
spring-jdbc
- CompoundJdbcEventListenerFactory
- EnableP6DataSource
- NoOpP6LoadableOptions
- P6DataSourceBeanDefinitionRegistrar
- P6DataSourceBeanPostProcessor
- PropertySourcesP6LoadableOptionsAdapter
- SpringP6SpyURLConnectionFactory
spring-test
- AbstractWebFluxTest
- AbstractWebMvcTest
- AnnotatedTypeMetadataTestFactory
- EmbeddedDataBaseBeanDefinitionRegistrar
- EmbeddedDataBaseBeanDefinitionsRegistrar
- EmbeddedDatabaseType
- EmbeddedTomcatConfiguration
- EmbeddedTomcatContextLoader
- EmbeddedTomcatMergedContextConfiguration
- EmbeddedTomcatTestContextBootstrapper
- EmbeddedZookeeperServer
- EmbeddedZookeeperServerTestExecutionListener
- EnableEmbeddedDatabase
- EnableEmbeddedDatabases
- MockServletWebRequest
- PersonHandler
- PersonHandler
- RouterFunctionTestConfig
- RouterFunctionTestConfig
- ServletTestUtils
- SimpleUrlHandlerMappingTestConfig
- SimpleUrlHandlerMappingTestConfig
- SpringLoggingTest
- SpringTestUtils
- SpringTestWebUtils
- TestConditionContext
- TestController
- TestFilter
- TestFilterRegistration
- TestServlet
- TestServletContext
- TestServletContextListener
- TestServletRegistration
- User
- WebTestUtils
spring-web
- AbstractNameValueExpression
- AbstractWebEndpointMappingFactory
- AbstractWebRequestRule
- CompositeWebEndpointMappingRegistry
- CompositeWebRequestRule
- ConsumeMediaTypeExpression
- DelegatingHandlerMethodAdvice
- EnableWebExtension
- FilterRegistrationWebEndpointMappingFactory
- FilteringWebEndpointMappingRegistry
- GenericMediaTypeExpression
- HandlerMetadata
- HandlerMethodAdvice
- HandlerMethodArgumentInterceptor
- HandlerMethodArgumentsResolvedEvent
- HandlerMethodInterceptor
- HandlerMethodMetadata
- HttpUtils
- Jackson2WebEndpointMappingFactory
- MediaTypeExpression
- MediaTypeUtils
- NameValueExpression
- ProduceMediaTypeExpression
- PropertyConstants
- RegistrationWebEndpointMappingFactory
- RequestAttributesUtils
- RequestContextStrategy
- ServletRegistrationWebEndpointMappingFactory
- ServletWebEndpointMappingResolver
- SimpleWebEndpointMappingRegistry
- SmartWebEndpointMappingFactory
- SpringWebHelper
- SpringWebType
- UnknownSpringWebHelper
- WebEndpointMapping
- WebEndpointMappingFactory
- WebEndpointMappingFilter
- WebEndpointMappingRegistrar
- WebEndpointMappingRegistry
- WebEndpointMappingResolver
- WebEndpointMappingsReadyEvent
- WebEventPublisher
- WebExtensionBeanDefinitionRegistrar
- WebRequestConsumesRule
- WebRequestHeaderExpression
- WebRequestHeadersRule
- WebRequestMethodsRule
- WebRequestParamExpression
- WebRequestParamsRule
- WebRequestPattensRule
- WebRequestProducesRule
- WebRequestRule
- WebRequestUtils
- WebScope
- WebSource
- WebTarget
- WebType
- WebUtils
spring-webflux
- CompositeWebFilter
- ConsumingWebEndpointMappingAdapter
- DelegatingWebFilter
- EnableWebFluxExtension
- HandlerMappingWebEndpointMappingFactory
- HandlerMappingWebEndpointMappingResolver
- HandlerMetadataWebEndpointMappingFactory
- InterceptingHandlerMethodProcessor
- MonoUtils
- RequestContextWebFilter
- RequestHandledEventPublishingWebFilter
- RequestMappingMetadataWebEndpointMappingFactory
- RequestPredicateKind
- RequestPredicateVisitorAdapter
- ReversedProxyHandlerMapping
- RouterFunctionVisitorAdapter
- ServerRequestHandledEvent
- ServerWebRequest
- SpringWebFluxHelper
- StoringRequestBodyArgumentInterceptor
- StoringResponseBodyReturnValueInterceptor
- WebFluxExtensionBeanDefinitionRegistrar
- WebServerScope
- WebServerUtils
spring-webmvc
- AbstractPageRenderContextHandlerInterceptor
- AnnotatedMethodHandlerInterceptor
- ConfigurableContentNegotiationManagerWebMvcConfigurer
- ConsumingWebEndpointMappingAdapter
- ContentCachingFilter
- EnableWebMvcExtension
- EnableWebMvcExtensionListener
- ExclusiveViewResolverApplicationListener
- HandlerMappingWebEndpointMappingFactory
- HandlerMappingWebEndpointMappingResolver
- HandlerMetadataWebEndpointMappingFactory
- HandlerMethodArgumentResolverAdvice
- InterceptingHandlerMethodProcessor
- LazyCompositeHandlerInterceptor
- LoggingHandlerMethodArgumentResolverAdvice
- LoggingMethodHandlerInterceptor
- LoggingPageRenderContextHandlerInterceptor
- MethodHandlerInterceptor
- PropertyConstants
- RequestBodyAdviceAdapter
- RequestMappingMetadata
- RequestMappingMetadataWebEndpointMappingFactory
- RequestPredicateVisitorAdapter
- ResponseBodyAdviceAdapter
- ReversedProxyHandlerMapping
- RouterFunctionVisitorAdapter
- SpringWebMvcHelper
- StoringRequestBodyArgumentAdvice
- StoringResponseBodyReturnValueAdvice
- ViewResolverUtils
- ViewUtils
- WebMvcExtensionBeanDefinitionRegistrar
- WebMvcExtensionConfiguration
- WebMvcUtils
- WebUtils