Also: SpringCore
public interface

PropertiesPersister

org.springframework.util.PropertiesPersister
Known Indirect Subclasses

Class Overview

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).

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.

Summary

Public Methods
abstract void load(Properties props, Reader reader)
Load properties from the given Reader into the given Properties object.
abstract void load(Properties props, InputStream is)
Load properties from the given InputStream into the given Properties object.
abstract void loadFromXml(Properties props, InputStream is)
Load properties from the given XML InputStream into the given Properties object.
abstract void store(Properties props, Writer writer, String header)
Write the contents of the given Properties object to the given Writer.
abstract void store(Properties props, OutputStream os, String header)
Write the contents of the given Properties object to the given OutputStream.
abstract void storeToXml(Properties props, OutputStream os, String header)
Write the contents of the given Properties object to the given XML OutputStream.
abstract void storeToXml(Properties props, OutputStream os, String header, String encoding)
Write the contents of the given Properties object to the given XML OutputStream.

Public Methods

public abstract void load (Properties props, Reader reader)

Also: SpringCore

Load properties from the given Reader into the given Properties object.

Parameters
props the Properties object to load into
reader the Reader to load from
Throws
IOException in case of I/O errors

public abstract void load (Properties props, InputStream is)

Also: SpringCore

Load properties from the given InputStream into the given Properties object.

Parameters
props the Properties object to load into
is the InputStream to load from
Throws
IOException in case of I/O errors

public abstract void loadFromXml (Properties props, InputStream is)

Also: SpringCore

Load properties from the given XML InputStream into the given Properties object.

Parameters
props the Properties object to load into
is the InputStream to load from
Throws
IOException in case of I/O errors

public abstract void store (Properties props, Writer writer, String header)

Also: SpringCore

Write the contents of the given Properties object to the given Writer.

Parameters
props the Properties object to store
writer the Writer to write to
header the description of the property list
Throws
IOException in case of I/O errors

public abstract void store (Properties props, OutputStream os, String header)

Also: SpringCore

Write the contents of the given Properties object to the given OutputStream.

Parameters
props the Properties object to store
os the OutputStream to write to
header the description of the property list
Throws
IOException in case of I/O errors

public abstract void storeToXml (Properties props, OutputStream os, String header)

Also: SpringCore

Write the contents of the given Properties object to the given XML OutputStream.

Parameters
props the Properties object to store
os the OutputStream to write to
header the description of the property list
Throws
IOException in case of I/O errors

public abstract void storeToXml (Properties props, OutputStream os, String header, String encoding)

Also: SpringCore

Write the contents of the given Properties object to the given XML OutputStream.

Parameters
props the Properties object to store
os the OutputStream to write to
header the description of the property list
encoding the encoding to use
Throws
IOException in case of I/O errors