Package: org.grails.datastore.mapping.config

[Groovy] Class ConfigurationBuilder<B, C>

    • Field Summary

        Fields 
        Modifiers Name Description
        protected B  rootBuilder
    • Constructor Summary

        Constructors 
        Constructor and description
        ConfigurationBuilder (org.springframework.core.env.PropertyResolver propertyResolver, java.lang.String configurationPrefix, java.lang.String builderMethodPrefix)
        @param propertyResolver The property resolver
        ConfigurationBuilder (org.springframework.core.env.PropertyResolver propertyResolver, java.lang.String configurationPrefix, java.lang.Object fallBackConfiguration = null, java.lang.String builderMethodPrefix = null)
        @param propertyResolver The property resolver
    • Methods Summary

        Methods 
        Type Params Return Type Name and description
        C build()
        protected void buildRecurse(java.lang.Object builder, java.lang.Object fallBackConfig, java.lang.String startingPrefix)
        protected 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 C toConfiguration(B builder)
        Convert the builder to the final configuration
    • Inherited Methods Summary

        Inherited Methods 
        Methods inherited from class Name
        class java.lang.Object java.lang.Object#wait(long, int), java.lang.Object#wait(long), 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()
    • Field Detail

      • protected B rootBuilder

    • Property Detail

      • final java.lang.String builderMethodPrefix

      • final java.lang.String configurationPrefix

      • final java.lang.Object fallBackConfiguration

      • final org.springframework.core.env.PropertyResolver propertyResolver

    • Constructor Detail

      • @groovy.transform.CompileDynamic ConfigurationBuilder(org.springframework.core.env.PropertyResolver propertyResolver, java.lang.String configurationPrefix, java.lang.String builderMethodPrefix)

        Parameters:
        propertyResolver - The property resolver
        configurationPrefix - 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(..)"

      • @groovy.transform.CompileDynamic ConfigurationBuilder(org.springframework.core.env.PropertyResolver propertyResolver, java.lang.String configurationPrefix, java.lang.Object fallBackConfiguration = null, java.lang.String builderMethodPrefix = null)

        Parameters:
        propertyResolver - The property resolver
        configurationPrefix - 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 from

    • Method Detail

      • C build()

      • protected void buildRecurse(java.lang.Object builder, java.lang.Object fallBackConfig, java.lang.String startingPrefix)

      • protected B createBuilder()

        Creates the native builder

        Returns:
        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

        Parameters:
        builder - The builder
        configurationPath - The configuration path

      • 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

        Parameters:
        builder - The current builder
        configurationPath - The configuration path

      • protected C toConfiguration(B builder)

        Convert the builder to the final configuration

        Parameters:
        builder - The builder
        Returns:
        The final configuration