类 ResourcePropertySource
java.lang.Object
cn.taketoday.core.env.PropertySource<T>
cn.taketoday.core.env.EnumerablePropertySource<Map<String,Object>>
cn.taketoday.core.env.MapPropertySource
cn.taketoday.core.env.PropertiesPropertySource
cn.taketoday.core.io.ResourcePropertySource
Subclass of
PropertiesPropertySource that loads a Properties object
from a given Resource or resource location such as
"classpath:/com/myco/foo.properties" or "file:/path/to/file.xml".
Both traditional and XML-based properties file formats are supported; however, in
order for XML processing to take effect, the underlying Resource's
getFilename() method must
return a non-null value that ends in ".xml".
- 从以下版本开始:
- 4.0
- 作者:
- Chris Beams, Juergen Hoeller, TODAY 2021/10/28 17:35
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 cn.taketoday.core.env.PropertySource
PropertySource.StubPropertySource -
字段概要
字段从类继承的字段 cn.taketoday.core.env.PropertySource
name, source -
构造器概要
构造器限定符构造器说明ResourcePropertySource(EncodedResource resource) Create a PropertySource based on Properties loaded from the given resource.ResourcePropertySource(Resource resource) Create a PropertySource based on Properties loaded from the given resource.ResourcePropertySource(String location) Create a PropertySource based on Properties loaded from the given resource location.ResourcePropertySource(String name, EncodedResource resource) Create a PropertySource having the given name based on Properties loaded from the given encoded resource.ResourcePropertySource(String name, Resource resource) Create a PropertySource having the given name based on Properties loaded from the given encoded resource.ResourcePropertySource(String location, ClassLoader classLoader) Create a PropertySource based on Properties loaded from the given resource location and use the given class loader to load the resource, assuming it is prefixed withclasspath:.ResourcePropertySource(String name, String location) Create a PropertySource having the given name based on Properties loaded from the given resource location.ResourcePropertySource(String name, String location, ClassLoader classLoader) Create a PropertySource having the given name based on Properties loaded from the given resource location and using the given class loader to load the resource (assuming it is prefixed withclasspath:).private -
方法概要
修饰符和类型方法说明private static StringgetNameForResource(Resource resource) Return the description for the given Resource; if the description is empty, return the class name of the resource plus its identity hash code.Return a potentially adapted variant of thisResourcePropertySource, overriding the previously given (or derived) name with the specified name.Return a potentially adapted variant of thisResourcePropertySource, overriding the previously given name (if any) with the original resource name (equivalent to the name generated by the name-less constructor variants).从类继承的方法 cn.taketoday.core.env.PropertiesPropertySource
getPropertyNames从类继承的方法 cn.taketoday.core.env.MapPropertySource
containsProperty, getProperty
-
字段详细资料
-
resourceName
The original resource name, if different from the given name.
-
-
构造器详细资料
-
ResourcePropertySource
Create a PropertySource having the given name based on Properties loaded from the given encoded resource.- 抛出:
IOException
-
ResourcePropertySource
Create a PropertySource based on Properties loaded from the given resource. The name of the PropertySource will be generated based on thedescriptionof the given resource.- 抛出:
IOException
-
ResourcePropertySource
Create a PropertySource having the given name based on Properties loaded from the given encoded resource.- 抛出:
IOException
-
ResourcePropertySource
Create a PropertySource based on Properties loaded from the given resource. The name of the PropertySource will be generated based on thedescriptionof the given resource.- 抛出:
IOException
-
ResourcePropertySource
public ResourcePropertySource(String name, String location, ClassLoader classLoader) throws IOException Create a PropertySource having the given name based on Properties loaded from the given resource location and using the given class loader to load the resource (assuming it is prefixed withclasspath:).- 抛出:
IOException
-
ResourcePropertySource
Create a PropertySource based on Properties loaded from the given resource location and use the given class loader to load the resource, assuming it is prefixed withclasspath:. The name of the PropertySource will be generated based on thedescriptionof the resource.- 抛出:
IOException
-
ResourcePropertySource
Create a PropertySource having the given name based on Properties loaded from the given resource location. The default thread context class loader will be used to load the resource (assuming the location string is prefixed withclasspath:.- 抛出:
IOException
-
ResourcePropertySource
Create a PropertySource based on Properties loaded from the given resource location. The name of the PropertySource will be generated based on thedescriptionof the resource.- 抛出:
IOException
-
ResourcePropertySource
-
-
方法详细资料
-
withName
Return a potentially adapted variant of thisResourcePropertySource, overriding the previously given (or derived) name with the specified name. -
withResourceName
Return a potentially adapted variant of thisResourcePropertySource, overriding the previously given name (if any) with the original resource name (equivalent to the name generated by the name-less constructor variants). -
getNameForResource
Return the description for the given Resource; if the description is empty, return the class name of the resource plus its identity hash code.- 另请参阅:
-