public interface PropertiesPersister
java.util.Properties
,
allowing for pluggable parsing strategies.
The default implementation is DefaultPropertiesPersister,
providing the native parsing of java.util.Properties
,
but allowing for reading from any Reader and writing to any Writer
(which allows to specify an encoding for a properties file).
As of Spring 1.2.2, this interface also supports properties XML files,
through the loadFromXml
and storeToXml
methods.
The default implementations delegate to JDK 1.5's corresponding methods.
DefaultPropertiesPersister
,
Properties
Modifier and Type | Method and Description |
---|---|
void |
load(Properties props,
InputStream is)
Load properties from the given InputStream into the given
Properties object.
|
void |
load(Properties props,
Reader reader)
Load properties from the given Reader into the given
Properties object.
|
void |
loadFromXml(Properties props,
InputStream is)
Load properties from the given XML InputStream into the
given Properties object.
|
void |
store(Properties props,
OutputStream os,
String header)
Write the contents of the given Properties object to the
given OutputStream.
|
void |
store(Properties props,
Writer writer,
String header)
Write the contents of the given Properties object to the
given Writer.
|
void |
storeToXml(Properties props,
OutputStream os,
String header)
Write the contents of the given Properties object to the
given XML OutputStream.
|
void |
storeToXml(Properties props,
OutputStream os,
String header,
String encoding)
Write the contents of the given Properties object to the
given XML OutputStream.
|
void load(Properties props, InputStream is) throws IOException
props
- the Properties object to load intois
- the InputStream to load fromIOException
- in case of I/O errorsProperties.load(java.io.Reader)
void load(Properties props, Reader reader) throws IOException
props
- the Properties object to load intoreader
- the Reader to load fromIOException
- in case of I/O errorsvoid store(Properties props, OutputStream os, String header) throws IOException
props
- the Properties object to storeos
- the OutputStream to write toheader
- the description of the property listIOException
- in case of I/O errorsProperties.store(java.io.Writer, java.lang.String)
void store(Properties props, Writer writer, String header) throws IOException
props
- the Properties object to storewriter
- the Writer to write toheader
- the description of the property listIOException
- in case of I/O errorsvoid loadFromXml(Properties props, InputStream is) throws IOException
props
- the Properties object to load intois
- the InputStream to load fromIOException
- in case of I/O errorsProperties.loadFromXML(java.io.InputStream)
void storeToXml(Properties props, OutputStream os, String header) throws IOException
props
- the Properties object to storeos
- the OutputStream to write toheader
- the description of the property listIOException
- in case of I/O errorsProperties.storeToXML(java.io.OutputStream, String)
void storeToXml(Properties props, OutputStream os, String header, String encoding) throws IOException
props
- the Properties object to storeos
- the OutputStream to write toencoding
- the encoding to useheader
- the description of the property listIOException
- in case of I/O errorsProperties.storeToXML(java.io.OutputStream, String, String)