private static ThemeSettings getThemeSettings( BootstrapHandler.BootstrapContext context, ThemeDefinition themeDefinition) { ThemeSettings settings = new ThemeSettings(); Class<? extends AbstractTheme> themeClass = themeDefinition.getTheme(); AbstractTheme theme = ReflectTools.createInstance(themeClass); if (!context.isProductionMode()) { List<JsonObject> head = Stream .of(themeClass.getAnnotationsByType(HtmlImport.class)) .map(HtmlImport::value) .map(url -> createImportLink(context.getUriResolver(), url)) .map(BootstrapUtils::createInlineDependencyObject) .collect(Collectors.toList()); settings.setHeadContents(head); } settings.setHeadInjectedContent(createHeaderInlineScript(theme)); settings.setBodyAttributes( theme.getBodyAttributes(themeDefinition.getVariant())); return settings; }
if (!context.isProductionMode()) { exportUsageStatistics(document);