|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Object org.grails.plugin.platform.config.PluginConfigurationImpl
class PluginConfigurationImpl
Bean for declaring and accessing plugin config
Plugins declare the config they support, the expected types, validators and default values
This means they do not have to supply/merge default values into Config.
The values of these settings provided by the user are read from
Field Summary | |
---|---|
protected java.util.Map |
legacyPluginConfigurationEntries
|
protected java.util.List |
pluginConfigurationEntries
|
Property Summary | |
---|---|
static java.lang.Object |
PLUGIN_CONFIG_CLASS
|
org.springframework.context.ApplicationContext |
applicationContext
|
java.lang.Object |
grailsApplication
|
java.lang.Object |
injectedMethods
|
java.lang.Object |
log
|
java.lang.Object |
pluginManager
|
Constructor Summary | |
PluginConfigurationImpl()
|
Method Summary | |
---|---|
void
|
applyAppPluginConfiguration(groovy.util.ConfigObject appPluginConfig)
Load plugin config settigns from PluginConfig.groovy and merge into main app config |
void
|
applyConfig()
Take app config, merge in config from PluginConfig.groovy and then doWithConfig blocks, and validate the whole lot according to doWithConfigOptions |
void
|
applyPluginConfigurationDefaultValuesAndConstraints()
Apply plugin-supplied config defaults for declared config values if values are missing and then validate |
void
|
clearCaches()
|
java.util.List
|
getAllEntries()
Get information about all the declared plugin config variables |
groovy.util.ConfigObject
|
getPluginConfig(java.lang.String pluginName)
Return the plugin-specific ConfigObject for the given plugin |
groovy.util.ConfigObject
|
getPluginConfigFor(java.lang.Object objectInstance)
Get pluginConfig for any object, determined by the plugin in which is was defined |
protected void
|
loadConfigurationOptions()
Load up all the doWithConfigOptions metadata |
protected groovy.util.ConfigObject
|
loadPluginConfig()
|
void
|
mergeConfigs(groovy.util.ConfigObject newConfig, groovy.util.ConfigObject oldConfig)
Merge new into old, working around the problems with merging ConfigObjects that already have values or already have empty nodes in the old one |
void
|
mergeDoWithConfig()
Load cross-plugin doWithConfig configuration and merge into main app config |
void
|
migrateLegacyConfigValues(boolean overwriteExisting)
Find any config values that start with legacy prefixes from doWithConfigOptions and copy them into the correct plugin namespace so that plugins only need to check the new location |
groovy.util.ConfigObject
|
parseConfigClosure(groovy.lang.Closure c)
Take a Closure and use it as config, returns a ConfigObject |
void
|
reload()
|
groovy.util.ConfigObject
|
safeConfigMerge(java.util.Map config, java.util.Map other)
Copies values from other into config, only if no value already exists in config Impl works around bug with other containing empty ConfigObject that obliterate non-Map valus in config |
protected void
|
setConfigValueByPath(java.lang.String fullPath, java.lang.Object value, boolean overwriteExisting = true)
Set an app config value using a full string path key |
void
|
verifyConfig()
Warn the user if any plugin.x config exists that is not declared by a plugin |
Methods inherited from 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 java.util.Map legacyPluginConfigurationEntries
protected java.util.List pluginConfigurationEntries
Property Detail |
---|
static java.lang.Object PLUGIN_CONFIG_CLASS
org.springframework.context.ApplicationContext applicationContext
java.lang.Object grailsApplication
java.lang.Object injectedMethods
final java.lang.Object log
java.lang.Object pluginManager
Constructor Detail |
---|
PluginConfigurationImpl()
Method Detail |
---|
void applyAppPluginConfiguration(groovy.util.ConfigObject appPluginConfig)
void applyConfig()
void applyPluginConfigurationDefaultValuesAndConstraints()
void clearCaches()
java.util.List getAllEntries()
groovy.util.ConfigObject getPluginConfig(java.lang.String pluginName)
pluginName
- the BEAN notation name of the plugin e.g. beanFields
groovy.util.ConfigObject getPluginConfigFor(java.lang.Object objectInstance)
protected void loadConfigurationOptions()
protected groovy.util.ConfigObject loadPluginConfig()
void mergeConfigs(groovy.util.ConfigObject newConfig, groovy.util.ConfigObject oldConfig)
void mergeDoWithConfig()
void migrateLegacyConfigValues(boolean overwriteExisting)
groovy.util.ConfigObject parseConfigClosure(groovy.lang.Closure c)
void reload()
groovy.util.ConfigObject safeConfigMerge(java.util.Map config, java.util.Map other)
protected void setConfigValueByPath(java.lang.String fullPath, java.lang.Object value, boolean overwriteExisting = true)
void verifyConfig()
Groovy Documentation