for(int i = 0; i < chainConfigs.size(); i++) {
CommandConfig commandConfig = (CommandConfig)chainConfigs.get(i);
assert commandConfig != null;
if(commandConfig instanceof ChainConfig) {
ChainConfig chainConfig = (ChainConfig)commandConfig;
Chain chain = new ChainBase();
List commandConfigs = chainConfig.getCommands();
for(int j = 0; j < commandConfigs.size(); j++) {
CommandConfig chainCommandConfig = (CommandConfig)commandConfigs.get(j);
Command command = createCommand(chainCommandConfig);
chain.addCommand(command);
}
catalog.addCommand(chainConfig.getName(), chain);
}
else {
Command command = createCommand(commandConfig);
catalog.addCommand(commandConfig.getId(), command);
}