Interface BasicBuilderProperties<T>
- Type Parameters:
T
- the type of the result of all set methods for method chaining
- All Known Subinterfaces:
CombinedBuilderParameters
,DatabaseBuilderParameters
,FileBasedBuilderParameters
,HierarchicalBuilderParameters
,INIBuilderParameters
,JndiBuilderParameters
,MultiFileBuilderParameters
,PropertiesBuilderParameters
,XMLBuilderParameters
- All Known Implementing Classes:
BasicBuilderParameters
,CombinedBuilderParametersImpl
,DatabaseBuilderParametersImpl
,FileBasedBuilderParametersImpl
,HierarchicalBuilderParametersImpl
,INIBuilderParametersImpl
,JndiBuilderParametersImpl
,MultiFileBuilderParametersImpl
,PropertiesBuilderParametersImpl
,XMLBuilderParametersImpl
public interface BasicBuilderProperties<T>
Definition of a properties interface for basic parameters which are supported by all ConfigurationBuilder
implementations derived from BasicConfigurationBuilder
.
This interface defines the single properties supported by a parameters object. Properties can be set using a fluent API making it convenient for client code to specify concrete property values in a single statement.
Important note: This interface is not intended to be implemented by client code! It defines a set of available properties and may be extended even in minor releases.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionsetBeanHelper
(BeanHelper beanHelper) Sets aBeanHelper
object to be used by the configuration builder.Sets theConfigurationDecoder
object for this configuration.setConversionHandler
(ConversionHandler handler) Sets theConversionHandler
object for this configuration.setDefaultLookups
(Collection<? extends Lookup> lookups) Adds additional defaultLookup
objects (i.e.Sets theConfigurationInterpolator
to be used for this configuration.Sets the value of the listDelimiterHandler property.Sets the logger property.Sets the parentConfigurationInterpolator
for this configuration'sConfigurationInterpolator
.setPrefixLookups
(Map<String, ? extends Lookup> lookups) Sets additionalLookup
objects for specific prefixes for this configuration object.setSynchronizer
(Synchronizer sync) Sets theSynchronizer
object for this configuration.setThrowExceptionOnMissing
(boolean b) Sets the value of the throwExceptionOnMissing property.
-
Method Details
-
setBeanHelper
Sets aBeanHelper
object to be used by the configuration builder. TheBeanHelper
is used to create the managed configuration instance dynamically. It is not a property of the configuration as most other properties defined by this interface. By setting an alternativeBeanHelper
the process of creating configuration instances via reflection can be adapted. (Some specialized configuration builder implementations also use aBeanHelper
to create complex helper objects during construction of their result object.CombinedConfigurationBuilder
for instance supports a complex configuration definition format which may contain several specialized bean declarations.) If no specificBeanHelper
is set, the builder uses the default instance.- Parameters:
beanHelper
- theBeanHelper
to be used by the builder- Returns:
- a reference to this object for method chaining
-
setConfigurationDecoder
Sets theConfigurationDecoder
object for this configuration. This object is called when encoded properties are queried using thegetEncodedString()
method.- Parameters:
decoder
- theConfigurationDecoder
to be used- Returns:
- a reference to this object for method chaining
-
setConversionHandler
Sets theConversionHandler
object for this configuration. This object is responsible for all data type conversions required for accessing configuration properties in a specific target type. If this property is not set, a defaultConversionHandler
is used.- Parameters:
handler
- theConversionHandler
to be used- Returns:
- a reference to this object for method chaining
-
setDefaultLookups
Adds additional defaultLookup
objects (i.e. lookups which are not associated with a specific prefix) to this configuration object. Note: This method only takes effect if noConfigurationInterpolator
is set using thesetInterpolator(ConfigurationInterpolator)
method.- Parameters:
lookups
- a collection withLookup
objects to be added as default lookups at the configuration'sConfigurationInterpolator
- Returns:
- a reference to this object for method chaining
- See Also:
-
setInterpolator
Sets theConfigurationInterpolator
to be used for this configuration. Using this method a customConfigurationInterpolator
can be set which can be freely configured. Alternatively, it is possible to add customLookup
objects using other methods provided by this interface.- Parameters:
ci
- theConfigurationInterpolator
for this configuration- Returns:
- a reference to this object for method chaining
-
setListDelimiterHandler
Sets the value of the listDelimiterHandler property. This property defines the object responsible for dealing with list delimiter and escaping characters. Note:AbstractConfiguration
does not allow setting this property to null. If the defaultListDelimiterHandler
is to be used, do not call this method.- Parameters:
handler
- theListDelimiterHandler
- Returns:
- a reference to this object for method chaining
-
setLogger
Sets the logger property. With this property a concreteConfigurationLogger
object can be set for the configuration. Thus logging behavior can be controlled.- Parameters:
log
- theLog
for the configuration produced by this builder- Returns:
- a reference to this object for method chaining
-
setParentInterpolator
Sets the parentConfigurationInterpolator
for this configuration'sConfigurationInterpolator
. Setting a parentConfigurationInterpolator
can be used for defining a default behavior for variables which cannot be resolved.- Parameters:
parent
- the new parentConfigurationInterpolator
- Returns:
- a reference to this object for method chaining
- See Also:
-
setPrefixLookups
Sets additionalLookup
objects for specific prefixes for this configuration object. AllLookup
objects contained in the given map are added to the configuration'sConfigurationInterpolator
. Note: This method only takes effect if noConfigurationInterpolator
is set using thesetInterpolator(ConfigurationInterpolator)
method.- Parameters:
lookups
- a map withLookup
objects and their associated prefixes- Returns:
- a reference to this object for method chaining
- See Also:
-
setSynchronizer
Sets theSynchronizer
object for this configuration. This object is used to protect this configuration instance against concurrent access. The concreteSynchronizer
implementation used determines whether a configuration instance is thread-safe or not.- Parameters:
sync
- theSynchronizer
to be used (a value of null means that a defaultSynchronizer
is used)- Returns:
- a reference to this object for method chaining
-
setThrowExceptionOnMissing
Sets the value of the throwExceptionOnMissing property. This property controls the configuration's behavior if missing properties are queried: a value of true causes the configuration to throw an exception, for a value of false it will return null values. (Note: Methods returning a primitive data type will always throw an exception if the property is not defined.)- Parameters:
b
- the value of the property- Returns:
- a reference to this object for method chaining
-