@groovy.transform.CompileStatic @groovy.util.logging.Slf4j abstract class ConfigurationBuilder<B, C> extends java.lang.Object
A generic configuration builder that implementers can implement to construct the configuration from the source org.springframework.core.env.PropertyResolver
B
- The builder type (examples are MongoClientSettings.Builder or Neo4j Bolt's Config.ConfigBuilderC
- The finalized configuration constructions from the builder (examples are MongoClientSettings or Neo4j Bolt's Config)Modifiers | Name | Description |
---|---|---|
private static java.util.Set<java.lang.String> |
IGNORE_METHODS |
|
private java.lang.String |
builderMethodPrefix |
|
private java.lang.String |
configurationPrefix |
|
private java.lang.Object |
fallBackConfiguration |
|
private org.springframework.core.env.PropertyResolver |
propertyResolver |
|
protected B |
rootBuilder |
Type | Name and description |
---|---|
java.lang.String |
builderMethodPrefix |
java.lang.String |
configurationPrefix |
java.lang.Object |
fallBackConfiguration |
org.springframework.core.env.PropertyResolver |
propertyResolver |
Constructor and description |
---|
ConfigurationBuilder
(org.springframework.core.env.PropertyResolver propertyResolver, java.lang.String configurationPrefix, java.lang.String builderMethodPrefix)
|
ConfigurationBuilder
(org.springframework.core.env.PropertyResolver propertyResolver, java.lang.String configurationPrefix, java.lang.Object fallBackConfiguration, java.lang.String builderMethodPrefix)
|
Type Params | Return Type | Name and description |
---|---|---|
|
C |
build() |
|
private C |
buildInternal(B builder, java.lang.String startingPrefix) |
|
protected void |
buildRecurse(java.lang.Object builder, java.lang.Object fallBackConfig, java.lang.String startingPrefix)
|
|
protected void |
buildRecurse(java.lang.Object builder, java.util.List<java.lang.Class> builderQueue, java.lang.Object fallBackConfig, java.lang.String startingPrefix) |
|
protected abstract B |
createBuilder() Creates the native builder |
|
protected java.lang.Object |
getFallBackValue(java.lang.Object fallBackConfig, java.lang.String methodName) |
|
protected void |
newChildBuilder(java.lang.Object builder, java.lang.String configurationPath) Subclasses can override for when a new child builder is created |
|
protected java.lang.Object |
newChildBuilderForFallback(java.lang.Object childBuilder, java.lang.Object fallbackConfig) |
|
protected void |
startBuild(java.lang.Object builder, java.lang.String configurationPath) Subclasses can override for when building starts for the given builder |
|
protected abstract C |
toConfiguration(B builder) Convert the builder to the final configuration |
|
private java.util.List<java.lang.Class> |
toHierarchy(java.lang.Class cls) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
propertyResolver
- The property resolverconfigurationPrefix
- The prefix to resolve settings from within the configuration. Example "grails.gorm.neo4j" or "grails.gorm.mongodb"builderMethodPrefix
- The prefix to builder method calls. Default is null which results in builder methods like "foo(...)". Seting a prefix of "with" results in "withFoo(..)"
propertyResolver
- The property resolverconfigurationPrefix
- The prefix to resolve settings from within the configuration. Example "grails.gorm.neo4j" or "grails.gorm.mongodb"builderMethodPrefix
- The prefix to builder method calls. Default is null which results in builder methods like "foo(...)". Seting a prefix of "with" results in "withFoo(..)"fallBackConfiguration
- An object to read the fallback configuration fromCreates the native builder
Subclasses can override for when a new child builder is created
builder
- The builderconfigurationPath
- The configuration pathSubclasses can override for when building starts for the given builder
builder
- The current builderconfigurationPath
- The configuration pathConvert the builder to the final configuration
builder
- The builderGroovy Documentation