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 aBeanHelperobject to be used by the configuration builder.Sets theConfigurationDecoderobject for this configuration.setConversionHandler(ConversionHandler handler) Sets theConversionHandlerobject for this configuration.setDefaultLookups(Collection<? extends Lookup> lookups) Adds additional defaultLookupobjects (i.e. lookups which are not associated with a specific prefix) to this configuration object.Sets theConfigurationInterpolatorto be used for this configuration.Sets the value of the listDelimiterHandler property.Sets the logger property.Sets the parentConfigurationInterpolatorfor this configuration'sConfigurationInterpolator.setPrefixLookups(Map<String, ? extends Lookup> lookups) Sets additionalLookupobjects for specific prefixes for this configuration object.setSynchronizer(Synchronizer sync) Sets theSynchronizerobject for this configuration.setThrowExceptionOnMissing(boolean b) Sets the value of the throwExceptionOnMissing property.
-
Method Details
-
setBeanHelper
Sets aBeanHelperobject to be used by the configuration builder. TheBeanHelperis 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 alternativeBeanHelperthe process of creating configuration instances via reflection can be adapted. (Some specialized configuration builder implementations also use aBeanHelperto create complex helper objects during construction of their result object.CombinedConfigurationBuilderfor instance supports a complex configuration definition format which may contain several specialized bean declarations.) If no specificBeanHelperis set, the builder uses the default instance.- Parameters:
beanHelper- theBeanHelperto be used by the builder- Returns:
- a reference to this object for method chaining
-
setConfigurationDecoder
Sets theConfigurationDecoderobject for this configuration. This object is called when encoded properties are queried using thegetEncodedString()method.- Parameters:
decoder- theConfigurationDecoderto be used- Returns:
- a reference to this object for method chaining
-
setConversionHandler
Sets theConversionHandlerobject 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 defaultConversionHandleris used.- Parameters:
handler- theConversionHandlerto be used- Returns:
- a reference to this object for method chaining
-
setDefaultLookups
Adds additional defaultLookupobjects (i.e. lookups which are not associated with a specific prefix) to this configuration object. Note: This method only takes effect if noConfigurationInterpolatoris set using thesetInterpolator(ConfigurationInterpolator)method.- Parameters:
lookups- a collection withLookupobjects to be added as default lookups at the configuration'sConfigurationInterpolator- Returns:
- a reference to this object for method chaining
- See Also:
-
setInterpolator
Sets theConfigurationInterpolatorto be used for this configuration. Using this method a customConfigurationInterpolatorcan be set which can be freely configured. Alternatively, it is possible to add customLookupobjects using other methods provided by this interface.- Parameters:
ci- theConfigurationInterpolatorfor 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:AbstractConfigurationdoes not allow setting this property to null. If the defaultListDelimiterHandleris 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 concreteConfigurationLoggerobject can be set for the configuration. Thus logging behavior can be controlled.- Parameters:
log- theLogfor the configuration produced by this builder- Returns:
- a reference to this object for method chaining
-
setParentInterpolator
Sets the parentConfigurationInterpolatorfor this configuration'sConfigurationInterpolator. Setting a parentConfigurationInterpolatorcan 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 additionalLookupobjects for specific prefixes for this configuration object. AllLookupobjects contained in the given map are added to the configuration'sConfigurationInterpolator. Note: This method only takes effect if noConfigurationInterpolatoris set using thesetInterpolator(ConfigurationInterpolator)method.- Parameters:
lookups- a map withLookupobjects and their associated prefixes- Returns:
- a reference to this object for method chaining
- See Also:
-
setSynchronizer
Sets theSynchronizerobject for this configuration. This object is used to protect this configuration instance against concurrent access. The concreteSynchronizerimplementation used determines whether a configuration instance is thread-safe or not.- Parameters:
sync- theSynchronizerto be used (a value of null means that a defaultSynchronizeris 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
-