Interface PropertiesConfiguration.IOFactory
- All Known Implementing Classes:
PropertiesConfiguration.DefaultIOFactory
- Enclosing class:
PropertiesConfiguration
public static interface PropertiesConfiguration.IOFactory
Definition of an interface that allows customization of read and write operations.
For reading and writing properties files the inner classes
PropertiesReader and PropertiesWriter are used.
This interface defines factory methods for creating both a
PropertiesReader and a PropertiesWriter. An
object implementing this interface can be passed to the
setIOFactory() method of
PropertiesConfiguration. Every time the configuration is
read or written the IOFactory is asked to create the
appropriate reader or writer object. This provides an opportunity to
inject custom reader or writer implementations.
- Since:
- 1.7
- Version:
- $Id: PropertiesConfiguration.java 1534445 2013-10-22 01:19:43Z henning $
- Author:
- Stefano Mazzocchi, Jon S. Stevens, Dave Bryson, Geir Magnusson Jr., Leon Messerschmidt, Kent Johnson, Daniel Rall, Ilkka Priha, Jason van Zyl, Martin Poeschl, Henning P. Schmiedehausen, Eric Pugh, Emmanuel Bourg
-
Method Summary
Modifier and TypeMethodDescriptioncreatePropertiesReader(Reader in, char delimiter) Creates aPropertiesReaderfor reading a properties file.createPropertiesWriter(Writer out, char delimiter) Creates aPropertiesWriterfor writing a properties file.
-
Method Details
-
createPropertiesReader
Creates aPropertiesReaderfor reading a properties file. This method is called whenever thePropertiesConfigurationis loaded. The reader returned by this method is then used for parsing the properties file.- Parameters:
in- the underlying reader (of the properties file)delimiter- the delimiter character for list parsing- Returns:
- the
PropertiesReaderfor loading the configuration
-
createPropertiesWriter
Creates aPropertiesWriterfor writing a properties file. This method is called before thePropertiesConfigurationis saved. The writer returned by this method is then used for writing the properties file.- Parameters:
out- the underlying writer (to the properties file)delimiter- the delimiter character for list parsing- Returns:
- the
PropertiesWriterfor saving the configuration
-