|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.core.env.PropertySource<T> org.springframework.core.env.EnumerablePropertySource<java.util.Map<java.lang.String,java.lang.Object>> org.springframework.core.env.MapPropertySource org.springframework.core.env.PropertiesPropertySource org.springframework.core.io.ResourcePropertySource
public class 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.properties"
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.springframework.core.env.PropertySource |
---|
PropertySource.StubPropertySource |
Field Summary |
---|
Fields inherited from class org.springframework.core.env.EnumerablePropertySource |
---|
EMPTY_NAMES_ARRAY, logger |
Fields inherited from class org.springframework.core.env.PropertySource |
---|
name, source |
Constructor Summary | |
---|---|
ResourcePropertySource(Resource resource)
Create a PropertySource based on Properties loaded from the given resource. |
|
ResourcePropertySource(java.lang.String location)
Create a PropertySource based on Properties loaded from the given resource location. |
|
ResourcePropertySource(java.lang.String location,
java.lang.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 with classpath: . |
|
ResourcePropertySource(java.lang.String name,
Resource resource)
Create a PropertySource having the given name based on Properties loaded from the given resource. |
|
ResourcePropertySource(java.lang.String name,
java.lang.String location)
Create a PropertySource having the given name based on Properties loaded from the given resource location. |
|
ResourcePropertySource(java.lang.String name,
java.lang.String location,
java.lang.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 with classpath: ). |
Method Summary | |
---|---|
private static java.lang.String |
getNameForResource(Resource resource)
Returns the description string for the resource, and if empty returns the class name of the resource plus its identity hash code. |
private static Resource |
getResourceForLocation(java.lang.String location,
java.lang.ClassLoader classLoader)
|
private static java.util.Properties |
loadPropertiesForResource(Resource resource)
|
Methods inherited from class org.springframework.core.env.MapPropertySource |
---|
getProperty, getPropertyNames |
Methods inherited from class org.springframework.core.env.EnumerablePropertySource |
---|
containsProperty |
Methods inherited from class org.springframework.core.env.PropertySource |
---|
equals, getName, getSource, hashCode, named, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ResourcePropertySource(java.lang.String name, Resource resource) throws java.io.IOException
java.io.IOException
public ResourcePropertySource(Resource resource) throws java.io.IOException
description
of the given resource.
java.io.IOException
public ResourcePropertySource(java.lang.String name, java.lang.String location, java.lang.ClassLoader classLoader) throws java.io.IOException
classpath:
).
java.io.IOException
public ResourcePropertySource(java.lang.String name, java.lang.String location) throws java.io.IOException
classpath:
.
java.io.IOException
public ResourcePropertySource(java.lang.String location, java.lang.ClassLoader classLoader) throws java.io.IOException
classpath:
. The name of the PropertySource will be
generated based on the description
of the
resource.
java.io.IOException
public ResourcePropertySource(java.lang.String location) throws java.io.IOException
description
of the resource.
java.io.IOException
Method Detail |
---|
private static Resource getResourceForLocation(java.lang.String location, java.lang.ClassLoader classLoader)
private static java.util.Properties loadPropertiesForResource(Resource resource) throws java.io.IOException
java.io.IOException
private static java.lang.String getNameForResource(Resource resource)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |