Interface CombinedBuilderProperties<T>
- Type Parameters:
T
- the return type of all methods for allowing method chaining
- All Known Subinterfaces:
CombinedBuilderParameters
- All Known Implementing Classes:
CombinedBuilderParametersImpl
public interface CombinedBuilderProperties<T>
Definition of a properties interface for the parameters of a combined configuration builder.
This interface defines a number of properties for adapting the construction of a combined configuration based on a definition configuration. Properties can be set in a fluent style.
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 TypeMethodDescription<D> T
registerChildDefaultsHandler
(Class<D> paramClass, DefaultParametersHandler<? super D> handler) Registers aDefaultParametersHandler
for child configuration sources.<D> T
registerChildDefaultsHandler
(Class<D> paramClass, DefaultParametersHandler<? super D> handler, Class<?> startClass) Registers aDefaultParametersHandler
for child configuration sources derived from the given start class.registerProvider
(String tagName, ConfigurationBuilderProvider provider) Registers the givenConfigurationBuilderProvider
for the specified tag name.setBasePath
(String path) Sets the base path for this combined configuration builder.Sets aDefaultParametersManager
object responsible for managing the default parameter handlers to be applied on child configuration sources.setDefinitionBuilder
(ConfigurationBuilder<? extends HierarchicalConfiguration<?>> builder) Sets theConfigurationBuilder
for the definition configuration.Sets the parameters object for the definition configuration builder.setInheritSettings
(boolean f) Sets a flag whether the child configurations created by aCombinedConfigurationBuilder
should inherit the settings defined for the builder.
-
Method Details
-
registerChildDefaultsHandler
<D> T registerChildDefaultsHandler(Class<D> paramClass, DefaultParametersHandler<? super D> handler) Registers aDefaultParametersHandler
for child configuration sources. With this method an arbitrary number of handler objects can be set. When creating builders for child configuration sources their parameters are initialized by invoking all matchingDefaultParametersHandler
s on them. So, basically the same mechanism is used for the initialization of parameters for child configuration sources as for normal parameter objects.- Type Parameters:
D
- the type of the handler to be registered- Parameters:
paramClass
- the parameter class supported by the handlerhandler
- theDefaultParametersHandler
to be registered- Returns:
- a reference to this object for method chaining
- See Also:
-
registerChildDefaultsHandler
<D> T registerChildDefaultsHandler(Class<D> paramClass, DefaultParametersHandler<? super D> handler, Class<?> startClass) Registers aDefaultParametersHandler
for child configuration sources derived from the given start class. This method works like the overloaded variant, but limits the application of the defaults handler to specific child configuration sources.- Type Parameters:
D
- the type of the handler to be registered- Parameters:
paramClass
- the parameter class supported by the handlerhandler
- theDefaultParametersHandler
to be registeredstartClass
- an optional start class in the hierarchy of parameter objects for which this handler should be applied- Returns:
- a reference to this object for method chaining
- See Also:
-
registerProvider
Registers the givenConfigurationBuilderProvider
for the specified tag name. This means that whenever this tag is encountered in a configuration definition file, the corresponding builder provider is invoked.- Parameters:
tagName
- the name of the tag (must not be null)provider
- theConfigurationBuilderProvider
(must not be null)- Returns:
- a reference to this object for method chaining
- Throws:
IllegalArgumentException
- if a required parameter is missing
-
setBasePath
Sets the base path for this combined configuration builder. Normally it it not necessary to set the base path explicitly. Per default, relative file names of configuration sources are resolved based on the location of the definition file. If this is not desired or if the definition configuration is loaded by a different means, the base path for relative file names can be specified using this method.- Parameters:
path
- the base path for resolving relative file names- Returns:
- a reference to this object for method chaining
-
setChildDefaultParametersManager
Sets aDefaultParametersManager
object responsible for managing the default parameter handlers to be applied on child configuration sources. When creating builders for child configuration sources their parameters are initialized using thisDefaultParametersManager
instance. This way, meaningful defaults can be set. Note that calling this method overrides allDefaultParametersHandler
objects previously set by one of theregisterChildDefaultsHandler()
methods! So either use this method if a pre-configured manager object is to be set or call theregisterChildDefaultHandler()
methods with the handlers to be registered (in the latter case, it is not necessary to set aDefaultParametersManager
explicitly; a default one is created behind the scenes).- Parameters:
manager
- theDefaultParametersManager
- Returns:
- a reference to this object for method chaining
-
setDefinitionBuilder
Sets theConfigurationBuilder
for the definition configuration. This is the configuration which contains the configuration sources that form the combined configuration.- Parameters:
builder
- the definitionConfigurationBuilder
- Returns:
- a reference to this object for method chaining
-
setDefinitionBuilderParameters
Sets the parameters object for the definition configuration builder. This property is evaluated only if the definition configuration builder is not set explicitly (using thesetDefinitionBuilder(ConfigurationBuilder)
method). In this case, a builder for an XML configuration is created and configured with this parameters object.- Parameters:
params
- the parameters object for the definition configuration builder- Returns:
- a reference to this object for method chaining
-
setInheritSettings
Sets a flag whether the child configurations created by aCombinedConfigurationBuilder
should inherit the settings defined for the builder. This is typically useful because for configurations coming from homogeneous sources often similar conventions are used. Therefore, this flag is true per default.- Parameters:
f
- the flag whether settings should be inherited by child configurations- Returns:
- a reference to this object for method chaining
-