public class ConfigurationGraph extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEPENDENT_MODULE_KEY
The special property which identifies dependent modules.
|
static String |
MODULE_NAME_KEY
The special property which uniquely identifies the name of the module.
|
Constructor and Description |
---|
ConfigurationGraph(Map<org.apache.commons.configuration.Configuration,String> configurationNamePairs,
Consumer<String> nameValidator)
Create a configuration graph from a collection of Configuration, resource name pairs and a name validation
function.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
org.apache.commons.configuration.Configuration |
getConfiguration(String nodeName)
Return the configuration corresponding to a module name.
|
int |
hashCode() |
Stream<String> |
preOrderRightToLeftTraversal(String nodeName)
Find the prioritized stream of configurations for a given module (inclusive of the module itself).
|
protected Stream<String> |
preOrderRightToLeftTraversal(String nodeName,
List<String> path)
Find the prioritized stream of configurations for a given module (inclusive of the module itself).
|
public static final String MODULE_NAME_KEY
public static final String DEPENDENT_MODULE_KEY
public ConfigurationGraph(Map<org.apache.commons.configuration.Configuration,String> configurationNamePairs, Consumer<String> nameValidator)
configurationNamePairs
- A map whose keys are configurations and values are the resource names use to
report errors while processing configurations.nameValidator
- A function which throws exceptions on module names which are not valid.public org.apache.commons.configuration.Configuration getConfiguration(String nodeName)
nodeName
- The module name for the graphpublic Stream<String> preOrderRightToLeftTraversal(String nodeName) throws SystemConfigException
nodeName
- The name of the initial module whose dependency should be resolvedSystemConfigException
- if the graph can't be resolvedprotected Stream<String> preOrderRightToLeftTraversal(String nodeName, List<String> path) throws SystemConfigException
nodeName
- The name of the initial module whose dependencies to load (inclusively)path
- The list of nodes back to the root of the tree parseSystemConfigException
- if there is a broken or circular dependency linkCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.