Package org.apache.commons.configuration2.builder

# Class PropertiesBuilderParametersImpl

java.lang.Object
org.apache.commons.configuration2.builder.BasicBuilderParameters
org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl
org.apache.commons.configuration2.builder.PropertiesBuilderParametersImpl

All Implemented Interfaces:
  `Cloneable`, `BasicBuilderProperties<BasicBuilderParameters>`, `BuilderParameters`, `FileBasedBuilderProperties<FileBasedBuilderParametersImpl>`, `PropertiesBuilderProperties<PropertiesBuilderParametersImpl>`

public class PropertiesBuilderParametersImpl extends FileBasedBuilderParametersImpl implements PropertiesBuilderProperties<PropertiesBuilderParametersImpl>

A specialized parameter class for configuring `PropertiesConfiguration` instances.

This class allows setting of some properties specific to properties configuration, for example the layout object. By inheriting from `FileBasedBuilderParametersImpl`, basic properties and properties related to file-based configurations are available, too.

This class is not thread-safe. It is intended that an instance is constructed and initialized by a single thread during configuration of a `ConfigurationBuilder`.

Since:
  2.0

- ## Field Summary

  ### Fields inherited from interface org.apache.commons.configuration2.builder.BuilderParameters

  `RESERVED_PARAMETER_PREFIX`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PropertiesBuilderParametersImpl()`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `inheritFrom(Map<String,?> source)`
  Inherits properties from the specified map.
  `PropertiesBuilderParametersImpl`
  `setIncludeListener(ConfigurationConsumer<ConfigurationException> includeListener)`
  Sets the current include listener, may be null.
  `PropertiesBuilderParametersImpl`
  `setIncludesAllowed(boolean f)`
  Sets a flag whether include files are supported by the properties configuration object.
  `PropertiesBuilderParametersImpl`
  `setIOFactory(PropertiesConfiguration.IOFactory factory)`
  Sets the `IOFactory` to be used by the properties configuration object.
  `PropertiesBuilderParametersImpl`
  `setLayout(PropertiesConfigurationLayout layout)`
  Sets the layout object for the properties configuration object.

  ### Methods inherited from class org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl

  `clone, fromMap, fromParameters, fromParameters, getFileHandler, getParameters, getReloadingDetectorFactory, getReloadingRefreshDelay, setBasePath, setEncoding, setFile, setFileName, setFileSystem, setLocationStrategy, setPath, setReloadingDetectorFactory, setReloadingRefreshDelay, setURL, setURL`

  ### Methods inherited from class org.apache.commons.configuration2.builder.BasicBuilderParameters

  `copyPropertiesFrom, fetchBeanHelper, fetchInterpolatorSpecification, fetchProperty, merge, setBeanHelper, setConfigurationDecoder, setConversionHandler, setDefaultLookups, setInterpolator, setListDelimiterHandler, setLogger, setParentInterpolator, setPrefixLookups, setSynchronizer, setThrowExceptionOnMissing, storeProperty`

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

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

- ## Constructor Details

  - ### PropertiesBuilderParametersImpl

    public PropertiesBuilderParametersImpl()
    Constructs a new instance.

- ## Method Details

  - ### inheritFrom

    public void inheritFrom(Map<String,?> source)
    Inherits properties from the specified map. This can be used for instance to reuse parameters from one builder in another builder - also in parent-child relations in which a parent builder creates child builders. The purpose of this method is to let a concrete implementation decide which properties can be inherited. Because parameters are basically organized as a map it would be possible to simply copy over all properties from the source object. However, this is not appropriate in all cases. For instance, some properties - like a `ConfigurationInterpolator` - are tightly connected to a configuration and cannot be reused in a different context. For other properties, for example a file name, it does not make sense to copy it. Therefore, an implementation has to be explicit in the properties it wants to take over. This implementation takes some properties defined in this class into account. This implementation takes some more properties into account that are defined in this class.
    Overrides:
      `inheritFrom` in class `FileBasedBuilderParametersImpl`
    Parameters:
      `source` - the source properties to inherit from

  - ### setIncludeListener

    public PropertiesBuilderParametersImpl setIncludeListener(ConfigurationConsumer<ConfigurationException> includeListener)
    Description copied from interface: `PropertiesBuilderProperties`
    Sets the current include listener, may be null.
    Specified by:
      `setIncludeListener` in interface `PropertiesBuilderProperties<PropertiesBuilderParametersImpl>`
    Parameters:
      `includeListener` - the current include listener, may be null.
    Returns:
      a reference to this object for method chaining

  - ### setIncludesAllowed

    public PropertiesBuilderParametersImpl setIncludesAllowed(boolean f)
    Description copied from interface: `PropertiesBuilderProperties`
    Sets a flag whether include files are supported by the properties configuration object. If set to true, files listed by an include property are loaded automatically.
    Specified by:
      `setIncludesAllowed` in interface `PropertiesBuilderProperties<PropertiesBuilderParametersImpl>`
    Parameters:
      `f` - the value of the flag
    Returns:
      a reference to this object for method chaining

  - ### setIOFactory

    public PropertiesBuilderParametersImpl setIOFactory(PropertiesConfiguration.IOFactory factory)
    Description copied from interface: `PropertiesBuilderProperties`
    Sets the `IOFactory` to be used by the properties configuration object. With this method a custom factory for input and output streams can be set. This allows customizing the format of properties read or written by the configuration. If no `IOFactory` is provided, the configuration uses a default one.
    Specified by:
      `setIOFactory` in interface `PropertiesBuilderProperties<PropertiesBuilderParametersImpl>`
    Parameters:
      `factory` - the `IOFactory` to be used by the configuration
    Returns:
      a reference to this object for method chaining

  - ### setLayout

    public PropertiesBuilderParametersImpl setLayout(PropertiesConfigurationLayout layout)
    Description copied from interface: `PropertiesBuilderProperties`
    Sets the layout object for the properties configuration object. With this method a custom layout object can be set. If no layout is provided, the configuration will use a default layout.
    Specified by:
      `setLayout` in interface `PropertiesBuilderProperties<PropertiesBuilderParametersImpl>`
    Parameters:
      `layout` - the `PropertiesConfigurationLayout` object to be used by the configuration
    Returns:
      a reference to this object for method chaining