Class 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, e.g. 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 Details

    • PROP_INCLUDE_LISTENER

      private static final String PROP_INCLUDE_LISTENER
      The key for the include listener property.
      See Also:
    • PROP_INCLUDES_ALLOWED

      private static final String PROP_INCLUDES_ALLOWED
      The key for the includes allowed property.
      See Also:
    • PROP_LAYOUT

      private static final String PROP_LAYOUT
      The key for the layout property.
      See Also:
    • PROP_IO_FACTORY

      private static final String PROP_IO_FACTORY
      The key for the IO factory property.
      See Also:
  • Constructor Details

    • PropertiesBuilderParametersImpl

      public PropertiesBuilderParametersImpl()
  • Method Details

    • setIncludeListener

      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
    • 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, e.g. 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
    • setLayout

      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
    • setIOFactory

      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