public List<ConfigKeyPath> getImportsRecursively(ConfigKeyPath configKey, Optional<Config> runtimeConfig) { if (this.cs instanceof ConfigStoreWithResolution) { return ((ConfigStoreWithResolution) this.cs).getImportsRecursively(configKey, this.version, runtimeConfig); } throw new UnsupportedOperationException("Internal ConfigStore does not support this operation"); }
private Config getResolvedConfigRecursive(ConfigKeyPath configKey, Set<String> alreadyLoadedPaths, Optional<Config> runtimeConfig) { if (this.cs instanceof ConfigStoreWithResolution) { return ((ConfigStoreWithResolution) this.cs).getResolvedConfig(configKey, this.version); } if (!alreadyLoadedPaths.add(configKey.getAbsolutePathString())) { return ConfigFactory.empty(); } Config initialConfig = this.getOwnConfig(configKey); if (configKey.isRootPath()) { return initialConfig; } List<ConfigKeyPath> ownImports = this.topology.getOwnImports(configKey, runtimeConfig); // merge with other configs from imports if (ownImports != null) { for (ConfigKeyPath p : ownImports) { initialConfig = initialConfig.withFallback(this.getResolvedConfigRecursive(p, alreadyLoadedPaths, runtimeConfig)); } } // merge with configs from parent for Non root initialConfig = initialConfig .withFallback(this.getResolvedConfigRecursive(configKey.getParent(), alreadyLoadedPaths, runtimeConfig)); return initialConfig; }
private Config getResolvedConfigRecursive(ConfigKeyPath configKey, Set<String> alreadyLoadedPaths, Optional<Config> runtimeConfig) { if (this.cs instanceof ConfigStoreWithResolution) { return ((ConfigStoreWithResolution) this.cs).getResolvedConfig(configKey, this.version); } if (!alreadyLoadedPaths.add(configKey.getAbsolutePathString())) { return ConfigFactory.empty(); } Config initialConfig = this.getOwnConfig(configKey); if (configKey.isRootPath()) { return initialConfig; } List<ConfigKeyPath> ownImports = this.topology.getOwnImports(configKey, runtimeConfig); // merge with other configs from imports if (ownImports != null) { for (ConfigKeyPath p : ownImports) { initialConfig = initialConfig.withFallback(this.getResolvedConfigRecursive(p, alreadyLoadedPaths, runtimeConfig)); } } // merge with configs from parent for Non root initialConfig = initialConfig .withFallback(this.getResolvedConfigRecursive(configKey.getParent(), alreadyLoadedPaths, runtimeConfig)); return initialConfig; }
public List<ConfigKeyPath> getImportsRecursively(ConfigKeyPath configKey, Optional<Config> runtimeConfig) { if (this.cs instanceof ConfigStoreWithResolution) { return ((ConfigStoreWithResolution) this.cs).getImportsRecursively(configKey, this.version, runtimeConfig); } throw new UnsupportedOperationException("Internal ConfigStore does not support this operation"); }