private void populateThemeModules() {

    if (serviceInfo.getThemesDir() == null) {
      serviceInfo.setThemesDir(StackDirectory.SERVICE_THEMES_FOLDER_NAME);
    }

    String themesDir = serviceDirectory.getAbsolutePath() + File.separator + serviceInfo.getThemesDir();

    if (serviceInfo.getThemes() != null) {
      List<ThemeInfo> themes = new ArrayList<>(serviceInfo.getThemes().size());
      for (ThemeInfo themeInfo : serviceInfo.getThemes()) {
        File themeFile = new File(themesDir + File.separator + themeInfo.getFileName());
        ThemeModule module = new ThemeModule(themeFile, themeInfo);
        if (module.isValid()) {
          themeModules.put(module.getId(), module);
          themes.add(themeInfo);
        }
        else {
          //lets not fail if theme contain errors
          LOG.error("Invalid theme {} for service {}", themeInfo.getFileName(), serviceInfo.getName());
        }
      }
      //filter out the invalid themes
      serviceInfo.setThemes(themes);
    }
  }
Parse and populate child configuration modules.
ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java