public class EnvironmentAwareModuleOptionsMetadataResolver extends java.lang.Object implements ModuleOptionsMetadataResolver, org.springframework.context.ResourceLoaderAware, org.springframework.context.EnvironmentAware
ModuleOptionsMetadataResolver
that will provide default values for module options
using the environment.
Each module gets its own Environment, populated with values in the following order:
$XD_MODULE_CONFIG_LOCATION/<type>/<module>/<module>.properties
.
Mappings in this file shall not use the fully qualified form, but rather the simple form
<optionname>=<optionvalue>
$XD_MODULE_CONFIG_LOCATION/$XD_MODULE_CONFIG_NAME
. Mappings in this file
use the fully qualified form (see below)
For each option <optionname>
of a module (of type <type>
and name <modulename>
), this
resolver will try to read a default from <type>.<modulename>.<optionname>
.
Constructor and Description |
---|
EnvironmentAwareModuleOptionsMetadataResolver() |
Modifier and Type | Method and Description |
---|---|
ModuleOptionsMetadata |
resolve(ModuleDefinition moduleDefinition)
Return metadata about a module, as identified by the given moduleDefinition.
|
void |
setConfigName(java.lang.String configName) |
void |
setDelegate(ModuleOptionsMetadataResolver delegate) |
void |
setEnvironment(org.springframework.core.env.Environment environment) |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
void |
setXdModuleConfigLocation(java.lang.String xdModuleConfigLocation) |
public EnvironmentAwareModuleOptionsMetadataResolver()
@Value(value="${xd.module.config.location:${xd.config.home}/modules/}") public void setXdModuleConfigLocation(java.lang.String xdModuleConfigLocation)
@Value(value="${xd.module.config.name:modules}") public void setConfigName(java.lang.String configName)
public void setDelegate(ModuleOptionsMetadataResolver delegate)
public ModuleOptionsMetadata resolve(ModuleDefinition moduleDefinition)
ModuleOptionsMetadataResolver
resolve
in interface ModuleOptionsMetadataResolver
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader
in interface org.springframework.context.ResourceLoaderAware
public void setEnvironment(org.springframework.core.env.Environment environment)
setEnvironment
in interface org.springframework.context.EnvironmentAware