Class PropertiesConfiguration.DefaultIOFactory
- java.lang.Object
-
- org.apache.commons.configuration2.PropertiesConfiguration.DefaultIOFactory
-
- All Implemented Interfaces:
PropertiesConfiguration.IOFactory
- Enclosing class:
- PropertiesConfiguration
public static class PropertiesConfiguration.DefaultIOFactory extends Object implements PropertiesConfiguration.IOFactory
A default implementation of the
IOFactoryinterface.This class implements the
createXXXX()methods defined by theIOFactoryinterface in a way that the default objects (i.e.PropertiesReaderandPropertiesWriterare returned. Customizing either the reader or the writer (or both) can be done by extending this class and overriding the correspondingcreateXXXX()method.- Since:
- 1.7
-
-
Constructor Summary
Constructors Constructor Description DefaultIOFactory()
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Constructor Detail
-
DefaultIOFactory
public DefaultIOFactory()
-
-
Method Detail
-
createPropertiesReader
public PropertiesConfiguration.PropertiesReader createPropertiesReader(Reader in)
Description copied from interface:PropertiesConfiguration.IOFactoryCreates 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.- Specified by:
createPropertiesReaderin interfacePropertiesConfiguration.IOFactory- Parameters:
in- the underlying reader (of the properties file)- Returns:
- the
PropertiesReaderfor loading the configuration
-
createPropertiesWriter
public PropertiesConfiguration.PropertiesWriter createPropertiesWriter(Writer out, ListDelimiterHandler handler)
Description copied from interface:PropertiesConfiguration.IOFactoryCreates 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.- Specified by:
createPropertiesWriterin interfacePropertiesConfiguration.IOFactory- Parameters:
out- the underlying writer (to the properties file)handler- the list delimiter delimiter for list parsing- Returns:
- the
PropertiesWriterfor saving the configuration
-
-