Class INIBuilderParametersImpl
- java.lang.Object
-
- org.apache.commons.configuration2.builder.BasicBuilderParameters
-
- org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl
-
- org.apache.commons.configuration2.builder.HierarchicalBuilderParametersImpl
-
- org.apache.commons.configuration2.builder.INIBuilderParametersImpl
-
- All Implemented Interfaces:
java.lang.Cloneable
,BasicBuilderProperties<BasicBuilderParameters>
,BuilderParameters
,FileBasedBuilderProperties<FileBasedBuilderParametersImpl>
,HierarchicalBuilderProperties<HierarchicalBuilderParametersImpl>
,INIBuilderProperties<INIBuilderParametersImpl>
public class INIBuilderParametersImpl extends HierarchicalBuilderParametersImpl implements INIBuilderProperties<INIBuilderParametersImpl>
A specialized parameters class for INI configuration.
This parameters class defines some properties which allow customizing the parsing and writing of INI documents.
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.2
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
PROP_COMMENT_LEADING_SEPARATOR_USED_IN_INI_INPUT
The key for the commentLeadingCharsUsedInInput property.private static java.lang.String
PROP_SEPARATOR_USED_IN_INI_INPUT
The key for the separatorUsedInInput property.private static java.lang.String
PROP_SEPARATOR_USED_IN_INI_OUTPUT
The key for the separatorUsedInINIOutput property.-
Fields inherited from interface org.apache.commons.configuration2.builder.BuilderParameters
RESERVED_PARAMETER_PREFIX
-
-
Constructor Summary
Constructors Constructor Description INIBuilderParametersImpl()
-
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.INIBuilderParametersImpl
setCommentLeadingCharsUsedInInput(java.lang.String separator)
Allows setting the leading comment separator which is used in reading an INI file.INIBuilderParametersImpl
setSeparatorUsedInInput(java.lang.String separator)
Allows setting the key and value separator which is used in reading an INI file.INIBuilderParametersImpl
setSeparatorUsedInOutput(java.lang.String separator)
Allows setting the separator between key and value to be used when writing an INI file.-
Methods inherited from class org.apache.commons.configuration2.builder.HierarchicalBuilderParametersImpl
setExpressionEngine
-
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
-
-
-
-
Field Detail
-
PROP_SEPARATOR_USED_IN_INI_OUTPUT
private static final java.lang.String PROP_SEPARATOR_USED_IN_INI_OUTPUT
The key for the separatorUsedInINIOutput property.- See Also:
- Constant Field Values
-
PROP_SEPARATOR_USED_IN_INI_INPUT
private static final java.lang.String PROP_SEPARATOR_USED_IN_INI_INPUT
The key for the separatorUsedInInput property.- See Also:
- Constant Field Values
-
PROP_COMMENT_LEADING_SEPARATOR_USED_IN_INI_INPUT
private static final java.lang.String PROP_COMMENT_LEADING_SEPARATOR_USED_IN_INI_INPUT
The key for the commentLeadingCharsUsedInInput property.- See Also:
- Constant Field Values
-
-
Method Detail
-
inheritFrom
public void inheritFrom(java.util.Map<java.lang.String,?> source)
Description copied from class:HierarchicalBuilderParametersImpl
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 copies some more properties defined by this class.- Overrides:
inheritFrom
in classHierarchicalBuilderParametersImpl
- Parameters:
source
- the source properties to inherit from
-
setCommentLeadingCharsUsedInInput
public INIBuilderParametersImpl setCommentLeadingCharsUsedInInput(java.lang.String separator)
Description copied from interface:INIBuilderProperties
Allows setting the leading comment separator which is used in reading an INI file.- Specified by:
setCommentLeadingCharsUsedInInput
in interfaceINIBuilderProperties<INIBuilderParametersImpl>
- Parameters:
separator
- String of the new separator for INI reading- Returns:
- a reference to this object for method chaining
-
setSeparatorUsedInInput
public INIBuilderParametersImpl setSeparatorUsedInInput(java.lang.String separator)
Description copied from interface:INIBuilderProperties
Allows setting the key and value separator which is used in reading an INI file.- Specified by:
setSeparatorUsedInInput
in interfaceINIBuilderProperties<INIBuilderParametersImpl>
- Parameters:
separator
- String of the new separator for INI reading- Returns:
- a reference to this object for method chaining
-
setSeparatorUsedInOutput
public INIBuilderParametersImpl setSeparatorUsedInOutput(java.lang.String separator)
Description copied from interface:INIBuilderProperties
Allows setting the separator between key and value to be used when writing an INI file.- Specified by:
setSeparatorUsedInOutput
in interfaceINIBuilderProperties<INIBuilderParametersImpl>
- Parameters:
separator
- the new separator for INI output- Returns:
- a reference to this object for method chaining
-
-