Interface PropertiesConfiguration.IOFactory
-
- All Known Implementing Classes:
PropertiesConfiguration.DefaultIOFactory,PropertiesConfiguration.JupIOFactory
- 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
PropertiesReaderandPropertiesWriterare used. This interface defines factory methods for creating both aPropertiesReaderand aPropertiesWriter. An object implementing this interface can be passed to thesetIOFactory()method ofPropertiesConfiguration. Every time the configuration is read or written theIOFactoryis asked to create the appropriate reader or writer object. This provides an opportunity to inject custom reader or writer implementations.- Since:
- 1.7
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PropertiesConfiguration.PropertiesReadercreatePropertiesReader(Reader in)Creates aPropertiesReaderfor reading a properties file.PropertiesConfiguration.PropertiesWritercreatePropertiesWriter(Writer out, ListDelimiterHandler handler)Creates aPropertiesWriterfor writing a properties file.
-
-
-
Method Detail
-
createPropertiesReader
PropertiesConfiguration.PropertiesReader createPropertiesReader(Reader in)
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)- Returns:
- the
PropertiesReaderfor loading the configuration
-
createPropertiesWriter
PropertiesConfiguration.PropertiesWriter createPropertiesWriter(Writer out, ListDelimiterHandler handler)
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)handler- the list delimiter delimiter for list parsing- Returns:
- the
PropertiesWriterfor saving the configuration
-
-