List of usage examples for org.apache.commons.configuration CombinedConfiguration getNodeCombiner
public NodeCombiner getNodeCombiner()
From source file:com.shanke.common.conf.CustomConfigurationBuilder.java
/** * Initializes a combined configuration for the configurations of a specific * section. This method is called for the override and for the additional * section (if it exists)./* w w w .ja v a2s. co m*/ * * @param config * the configuration to be initialized * @param containedConfigs * the list with the declaratinos of the contained configurations * @param keyListNodes * a list with the declaration of list nodes * @throws ConfigurationException * if an error occurs */ protected void initCombinedConfiguration(CombinedConfiguration config, List containedConfigs, String keyListNodes) throws ConfigurationException { List listNodes = getList(keyListNodes); for (Iterator it = listNodes.iterator(); it.hasNext();) { config.getNodeCombiner().addListNode((String) it.next()); } for (Iterator it = containedConfigs.iterator(); it.hasNext();) { HierarchicalConfiguration conf = (HierarchicalConfiguration) it.next(); ConfigurationDeclaration decl = new ConfigurationDeclaration(this, conf); AbstractConfiguration newConf = createConfigurationAt(decl); if (newConf != null) { config.addConfiguration(newConf, decl.getConfiguration().getString(ATTR_NAME), decl.getAt()); } } }