* implementation. If no parent definition is available, the built {@link ModuleDefinition} instance
* is added as a sibling to the {@link RootModuleDefinition}.
*/
public RootModuleDefinition getModuleDefinition() {
ModuleDefinition currentParentDefinition = parentDefinition;
for (String moduleName : modulesToLoad) {
ModuleDefinition definition = buildModuleDefinition(currentParentDefinition, moduleName);
if (currentParentDefinition == null) {
Assert.isTrue(!definition.getName().equals(rootModuleDefinition.getName()), "Module definition with no parent cannot be the root module definition");
rootModuleDefinition.addSibling(definition);
}
currentParentDefinition = definition;
}