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, 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 Summary
Fields inherited from interface org.apache.commons.configuration2.builder.BuilderParameters
RESERVED_PARAMETER_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
inheritFrom
(Map<String, ?> source) Inherits properties from the specified map.setIncludeListener
(ConfigurationConsumer<ConfigurationException> includeListener) Sets the current include listener, may be null.setIncludesAllowed
(boolean f) Sets a flag whether include files are supported by the properties configuration object.Sets theIOFactory
to be used by the properties configuration object.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
-
Constructor Details
-
PropertiesBuilderParametersImpl
public PropertiesBuilderParametersImpl()
-
-
Method Details
-
inheritFrom
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
-
setIncludeListener
public PropertiesBuilderParametersImpl setIncludeListener(ConfigurationConsumer<ConfigurationException> includeListener) Description copied from interface:PropertiesBuilderProperties
Sets the current include listener, may be null.- Specified by:
setIncludeListener
in interfacePropertiesBuilderProperties<PropertiesBuilderParametersImpl>
- Parameters:
includeListener
- the current include listener, may be null.- Returns:
- a reference to this object for method chaining
-
setIncludesAllowed
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
-
setIOFactory
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
-
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 interfacePropertiesBuilderProperties<PropertiesBuilderParametersImpl>
- Parameters:
layout
- thePropertiesConfigurationLayout
object to be used by the configuration- Returns:
- a reference to this object for method chaining
-