类的使用
org.springframework.core.env.PropertySource
使用PropertySource的程序包 程序包 说明 org.springframework.core.env Spring's environment abstraction consisting of bean definition profile and hierarchical property source support.org.springframework.core.io.support Support classes for Spring's resource abstraction.org.springframework.jndi The classes in this package make JNDI easier to use, facilitating the accessing of configuration stored in JNDI, and provide useful superclasses for JNDI access classes.org.springframework.mock.env This package contains mock implementations of theEnvironment
andPropertySource
abstractions introduced in Spring 3.1.org.springframework.web.context.support Classes supporting theorg.springframework.web.context
package, such as WebApplicationContext implementations and various utility classes.org.springframework.core.env中PropertySource的使用
org.springframework.core.env中PropertySource的子类 修饰符和类型 类 说明 class
CommandLinePropertySource<T>
Abstract base class forPropertySource
implementations backed by command line arguments.class
CompositePropertySource
CompositePropertySource
implementation that iterates over a set ofPropertySource
instances.class
EnumerablePropertySource<T>
APropertySource
implementation capable of interrogating its underlying source object to enumerate all possible property name/value pairs.class
JOptCommandLinePropertySource
CommandLinePropertySource
implementation backed by a JOptOptionSet
.class
MapPropertySource
PropertySource
that reads keys and values from aMap
object.class
PropertiesPropertySource
PropertySource
implementation that extracts properties from aProperties
object.static class
PropertySource.StubPropertySource
PropertySource
to be used as a placeholder in cases where an actual property source cannot be eagerly initialized at application context creation time.class
SimpleCommandLinePropertySource
CommandLinePropertySource
implementation backed by a simple String array.class
SystemEnvironmentPropertySource
Specialization ofMapPropertySource
designed for use with system environment variables.返回PropertySource的org.springframework.core.env中的方法 修饰符和类型 方法 说明 PropertySource<?>
MutablePropertySources. get(String name)
PropertySource<?>
PropertySources. get(String name)
Return the property source with the given name,null
if not found.static PropertySource<?>
PropertySource. named(String name)
Return aPropertySource
implementation intended for collection comparison purposes only.PropertySource<?>
MutablePropertySources. remove(String name)
Remove and return the property source with the given name,null
if not found.返回变量类型为PropertySource的类型的org.springframework.core.env中的方法 修饰符和类型 方法 说明 Collection<PropertySource<?>>
CompositePropertySource. getPropertySources()
Return all property sources that this composite source holds.Iterator<PropertySource<?>>
MutablePropertySources. iterator()
Spliterator<PropertySource<?>>
MutablePropertySources. spliterator()
Stream<PropertySource<?>>
MutablePropertySources. stream()
default Stream<PropertySource<?>>
PropertySources. stream()
Return a sequentialStream
containing the property sources.参数类型为PropertySource的org.springframework.core.env中的方法 修饰符和类型 方法 说明 void
MutablePropertySources. addAfter(String relativePropertySourceName, PropertySource<?> propertySource)
Add the given property source object with precedence immediately lower than the named relative property source.void
MutablePropertySources. addBefore(String relativePropertySourceName, PropertySource<?> propertySource)
Add the given property source object with precedence immediately higher than the named relative property source.void
MutablePropertySources. addFirst(PropertySource<?> propertySource)
Add the given property source object with highest precedence.void
CompositePropertySource. addFirstPropertySource(PropertySource<?> propertySource)
Add the givenPropertySource
to the start of the chain.void
MutablePropertySources. addLast(PropertySource<?> propertySource)
Add the given property source object with lowest precedence.void
CompositePropertySource. addPropertySource(PropertySource<?> propertySource)
Add the givenPropertySource
to the end of the chain.protected void
MutablePropertySources. assertLegalRelativeAddition(String relativePropertySourceName, PropertySource<?> propertySource)
Ensure that the given property source is not being added relative to itself.protected void
PropertySourcesPropertyResolver. logKeyFound(String key, PropertySource<?> propertySource, Object value)
Log the given key as found in the givenPropertySource
, resulting in the given value.int
MutablePropertySources. precedenceOf(PropertySource<?> propertySource)
Return the precedence of the given property source,-1
if not found.protected void
MutablePropertySources. removeIfPresent(PropertySource<?> propertySource)
Remove the given property source if it is present.void
MutablePropertySources. replace(String name, PropertySource<?> propertySource)
Replace the property source with the given name with the given property source object.org.springframework.core.io.support中PropertySource的使用
org.springframework.core.io.support中PropertySource的子类 修饰符和类型 类 说明 class
ResourcePropertySource
Subclass ofPropertiesPropertySource
that loads aProperties
object from a givenResource
or resource location such as"classpath:/com/myco/foo.properties"
or"file:/path/to/file.xml"
.返回PropertySource的org.springframework.core.io.support中的方法 修饰符和类型 方法 说明 PropertySource<?>
DefaultPropertySourceFactory. createPropertySource(String name, EncodedResource resource)
PropertySource<?>
PropertySourceFactory. createPropertySource(String name, EncodedResource resource)
Create aPropertySource
that wraps the given resource.org.springframework.jndi中PropertySource的使用
org.springframework.jndi中PropertySource的子类 修饰符和类型 类 说明 class
JndiPropertySource
PropertySource
implementation that reads properties from an underlying SpringJndiLocatorDelegate
.org.springframework.mock.env中PropertySource的使用
org.springframework.mock.env中PropertySource的子类 修饰符和类型 类 说明 class
MockPropertySource
SimplePropertySource
implementation for use in testing.org.springframework.web.context.support中PropertySource的使用
org.springframework.web.context.support中PropertySource的子类 修饰符和类型 类 说明 class
ServletConfigPropertySource
PropertySource
that reads init parameters from aServletConfig
object.class
ServletContextPropertySource
PropertySource
that reads init parameters from aServletContext
object.