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:
java.lang.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
- Version:
- $Id: PropertiesBuilderParametersImpl.java 1775894 2016-12-23 20:09:35Z oheger $
-
-
Field Summary
-
Fields inherited from interface org.apache.commons.configuration2.builder.BuilderParameters
RESERVED_PARAMETER_PREFIX
-
-
Constructor Summary
Constructors Constructor Description PropertiesBuilderParametersImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
inheritFrom(java.util.Map<java.lang.String,?> source)
Inherits properties from the specified map.PropertiesBuilderParametersImpl
setIncludesAllowed(boolean f)
Sets a flag whether include files are supported by the properties configuration object.PropertiesBuilderParametersImpl
setIOFactory(PropertiesConfiguration.IOFactory factory)
Sets theIOFactory
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
-
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
-
-
-
-
Method Detail
-
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 interfacePropertiesBuilderProperties<PropertiesBuilderParametersImpl>
- Parameters:
f
- the value of the flag- Returns:
- a reference to this object for method chaining
-
inheritFrom
public void inheritFrom(java.util.Map<java.lang.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 aConfigurationInterpolator
- 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 classFileBasedBuilderParametersImpl
- Parameters:
source
- the source properties to inherit from
-
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 interfacePropertiesBuilderProperties<PropertiesBuilderParametersImpl>
- Parameters:
layout
- thePropertiesConfigurationLayout
object to be used by the configuration- Returns:
- a reference to this object for method chaining
-
setIOFactory
public PropertiesBuilderParametersImpl setIOFactory(PropertiesConfiguration.IOFactory factory)
Description copied from interface:PropertiesBuilderProperties
Sets theIOFactory
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 noIOFactory
is provided, the configuration uses a default one.- Specified by:
setIOFactory
in interfacePropertiesBuilderProperties<PropertiesBuilderParametersImpl>
- Parameters:
factory
- theIOFactory
to be used by the configuration- Returns:
- a reference to this object for method chaining
-
-