Package org.apache.commons.configuration2

# 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 `IOFactory` interface.

This class implements the `createXXXX()` methods defined by the `IOFactory` interface in a way that the default objects (i.e. `PropertiesReader` and `PropertiesWriter` are returned. Customizing either the reader or the writer (or both) can be done by extending this class and overriding the corresponding `createXXXX()` method.

Since:
  1.7

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultIOFactory()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `PropertiesConfiguration.PropertiesReader`
  `createPropertiesReader(Reader in)`
  Creates a `PropertiesReader` for reading a properties file.
  `PropertiesConfiguration.PropertiesWriter`
  `createPropertiesWriter(Writer out, ListDelimiterHandler handler)`
  Creates a `PropertiesWriter` for writing a properties file.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DefaultIOFactory

    public DefaultIOFactory()

- ## Method Details

  - ### createPropertiesReader

    public PropertiesConfiguration.PropertiesReader createPropertiesReader(Reader in)
    Description copied from interface: `PropertiesConfiguration.IOFactory`
    Creates a `PropertiesReader` for reading a properties file. This method is called whenever the `PropertiesConfiguration` is loaded. The reader returned by this method is then used for parsing the properties file.
    Specified by:
      `createPropertiesReader` in interface `PropertiesConfiguration.IOFactory`
    Parameters:
      `in` - the underlying reader (of the properties file)
    Returns:
      the `PropertiesReader` for loading the configuration

  - ### createPropertiesWriter

    public PropertiesConfiguration.PropertiesWriter createPropertiesWriter(Writer out, ListDelimiterHandler handler)
    Description copied from interface: `PropertiesConfiguration.IOFactory`
    Creates a `PropertiesWriter` for writing a properties file. This method is called before the `PropertiesConfiguration` is saved. The writer returned by this method is then used for writing the properties file.
    Specified by:
      `createPropertiesWriter` in interface `PropertiesConfiguration.IOFactory`
    Parameters:
      `out` - the underlying writer (to the properties file)
      `handler` - the list delimiter delimiter for list parsing
    Returns:
      the `PropertiesWriter` for saving the configuration