Top Description Methods
org.springframework.util

public Interface PropertiesPersister

Known Direct Implementers
org.springframework.util.DefaultPropertiesPersister
Imports
java.io.IOException, .InputStream, .OutputStream, .Reader, .Writer, java.util.Properties

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

Author
Juergen Hoeller
Since
10.03.2004
See Also
DefaultPropertiesPersister, java.util.Properties

Method Summary

Modifier and TypeMethod and Description
public void
load(Properties
the Properties object to load into
props
,
InputStream
the InputStream to load from
is
)

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

public void
load(Properties
the Properties object to load into
props
,
Reader
the Reader to load from
reader
)

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

public void
loadFromXml(Properties
the Properties object to load into
props
,
InputStream
the InputStream to load from
is
)

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

public void
store(Properties
the Properties object to store
props
,
OutputStream
the OutputStream to write to
os
,
String
the description of the property list
header
)

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

public void
store(Properties
the Properties object to store
props
,
Writer
the Writer to write to
writer
,
String
the description of the property list
header
)

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

public void
storeToXml(Properties
the Properties object to store
props
,
OutputStream
the OutputStream to write to
os
,
String
the description of the property list
header
)

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

public void
storeToXml(Properties
the Properties object to store
props
,
OutputStream
the OutputStream to write to
os
,
String
the description of the property list
header
,
String
the encoding to use
encoding
)

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

Method Detail

loadback to summary
public void load(Properties props, InputStream is) throws IOException

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

Parameters
props:Properties

the Properties object to load into

is:InputStream

the InputStream to load from

Exceptions
IOException:
in case of I/O errors
See Also
java.util.Properties#load
loadback to summary
public void load(Properties props, Reader reader) throws IOException

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

Parameters
props:Properties

the Properties object to load into

reader:Reader

the Reader to load from

Exceptions
IOException:
in case of I/O errors
loadFromXmlback to summary
public void loadFromXml(Properties props, InputStream is) throws IOException

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

Parameters
props:Properties

the Properties object to load into

is:InputStream

the InputStream to load from

Exceptions
IOException:
in case of I/O errors
See Also
java.util.Properties#loadFromXML(java.io.InputStream)
storeback to summary
public void store(Properties props, OutputStream os, String header) throws IOException

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

Parameters
props:Properties

the Properties object to store

os:OutputStream

the OutputStream to write to

header:String

the description of the property list

Exceptions
IOException:
in case of I/O errors
See Also
java.util.Properties#store
storeback to summary
public void store(Properties props, Writer writer, String header) throws IOException

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

Parameters
props:Properties

the Properties object to store

writer:Writer

the Writer to write to

header:String

the description of the property list

Exceptions
IOException:
in case of I/O errors
storeToXmlback to summary
public void storeToXml(Properties props, OutputStream os, String header) throws IOException

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

Parameters
props:Properties

the Properties object to store

os:OutputStream

the OutputStream to write to

header:String

the description of the property list

Exceptions
IOException:
in case of I/O errors
See Also
java.util.Properties#storeToXML(java.io.OutputStream, String)
storeToXmlback to summary
public 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:Properties

the Properties object to store

os:OutputStream

the OutputStream to write to

header:String

the description of the property list

encoding:String

the encoding to use

Exceptions
IOException:
in case of I/O errors
See Also
java.util.Properties#storeToXML(java.io.OutputStream, String, String)