|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.core.io.support.PropertiesLoaderSupport
public abstract class PropertiesLoaderSupport
Base class for JavaBean-style components that need to load properties from one or more resources. Supports local properties as well, with configurable overriding.
Field Summary | |
---|---|
protected Log |
logger
Logger available to subclasses |
static String |
XML_FILE_EXTENSION
|
Constructor Summary | |
---|---|
PropertiesLoaderSupport()
|
Method Summary | |
---|---|
protected void |
loadProperties(Properties props)
Load properties into the given instance. |
protected Properties |
mergeProperties()
Return a merged Properties instance containing both the loaded properties and properties set on this FactoryBean. |
void |
setFileEncoding(String encoding)
Set the encoding to use for parsing properties files. |
void |
setIgnoreResourceNotFound(boolean ignoreResourceNotFound)
Set if failure to find the property resource should be ignored. |
void |
setLocalOverride(boolean localOverride)
Set whether local properties override properties from files. |
void |
setLocation(Resource location)
Set a location of a properties file to be loaded. |
void |
setLocations(Resource[] locations)
Set locations of properties files to be loaded. |
void |
setProperties(Properties properties)
Set local properties, e.g. via the "props" tag in XML bean definitions. |
void |
setPropertiesArray(Properties[] propertiesArray)
Set local properties, e.g. via the "props" tag in XML bean definitions, allowing for merging multiple properties sets into one. |
void |
setPropertiesPersister(PropertiesPersister propertiesPersister)
Set the PropertiesPersister to use for parsing properties files. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String XML_FILE_EXTENSION
protected final Log logger
Constructor Detail |
---|
public PropertiesLoaderSupport()
Method Detail |
---|
public void setProperties(Properties properties)
public void setPropertiesArray(Properties[] propertiesArray)
public void setLocation(Resource location)
Can point to a classic properties file or to an XML file that follows JDK 1.5's properties XML format.
public void setLocations(Resource[] locations)
Can point to classic properties files or to XML files that follow JDK 1.5's properties XML format.
public void setLocalOverride(boolean localOverride)
public void setIgnoreResourceNotFound(boolean ignoreResourceNotFound)
public void setFileEncoding(String encoding)
Default is none, using the java.util.Properties
default encoding.
Only applies to classic properties files, not to XML files.
PropertiesPersister.load(java.util.Properties, java.io.InputStream)
public void setPropertiesPersister(PropertiesPersister propertiesPersister)
DefaultPropertiesPersister
protected Properties mergeProperties() throws IOException
IOException
protected void loadProperties(Properties props) throws IOException
props
- the Properties instance to load into
IOException
- in case of I/O errorssetLocations(org.springframework.core.io.Resource[])
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |