Package org.springframework.util
Interface PropertiesPersister
- All Known Implementing Classes:
DefaultPropertiesPersister
,ResourcePropertiesPersister
public interface PropertiesPersister
Strategy interface for persisting
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).
- Since:
- 10.03.2004
- Author:
- Juergen Hoeller
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.
-
Method Details
-
load
Load properties from the given InputStream into the given Properties object.- Parameters:
props
- the Properties object to load intois
- the InputStream to load from- Throws:
IOException
- in case of I/O errors- See Also:
-
load
Load properties from the given Reader into the given Properties object.- Parameters:
props
- the Properties object to load intoreader
- the Reader to load from- Throws:
IOException
- in case of I/O errors
-
store
Write the contents of the given Properties object to the given OutputStream.- Parameters:
props
- the Properties object to storeos
- the OutputStream to write toheader
- the description of the property list- Throws:
IOException
- in case of I/O errors- See Also:
-
store
Write the contents of the given Properties object to the given Writer.- Parameters:
props
- the Properties object to storewriter
- the Writer to write toheader
- the description of the property list- Throws:
IOException
- in case of I/O errors
-
loadFromXml
Load properties from the given XML InputStream into the given Properties object.- Parameters:
props
- the Properties object to load intois
- the InputStream to load from- Throws:
IOException
- in case of I/O errors- See Also:
-
storeToXml
Write the contents of the given Properties object to the given XML OutputStream.- Parameters:
props
- the Properties object to storeos
- the OutputStream to write toheader
- the description of the property list- Throws:
IOException
- in case of I/O errors- See Also:
-
storeToXml
void storeToXml(Properties props, OutputStream os, String header, String encoding) throws IOException Write the contents of the given Properties object to the given XML OutputStream.- Parameters:
props
- the Properties object to storeos
- the OutputStream to write toencoding
- the encoding to useheader
- the description of the property list- Throws:
IOException
- in case of I/O errors- See Also:
-