@Nullable protected static HtmlScriptContentProvider findScriptContentProvider(@Nullable String mimeType) { if (StringUtil.isEmpty(mimeType)) { return ourDefaultLanguage != null ? LanguageHtmlScriptContentProvider.getScriptContentProvider(ourDefaultLanguage) : null; } Collection<Language> instancesByMimeType = Language.findInstancesByMimeType(mimeType.trim()); if (instancesByMimeType.isEmpty() && mimeType.contains("template")) { instancesByMimeType = Collections.<Language>singletonList(HTMLLanguage.INSTANCE); } for (Language language : instancesByMimeType) { HtmlScriptContentProvider scriptContentProvider = LanguageHtmlScriptContentProvider.getScriptContentProvider(language); if (scriptContentProvider != null) { return scriptContentProvider; } } return null; }
@Nullable protected HtmlScriptContentProvider findScriptContentProvider(@Nullable String mimeType) { if(StringUtil.isEmpty(mimeType)) { return ourDefaultLanguage != null ? LanguageHtmlScriptContentProvider.getScriptContentProvider(ourDefaultLanguage) : null; } Collection<Language> instancesByMimeType = Language.findInstancesByMimeType(mimeType.trim()); if(instancesByMimeType.isEmpty() && mimeType.contains("template")) { instancesByMimeType = Collections.singletonList(HTMLLanguage.INSTANCE); } for(Language language : instancesByMimeType) { HtmlScriptContentProvider scriptContentProvider = LanguageHtmlScriptContentProvider.getScriptContentProvider(language); if(scriptContentProvider != null) { return scriptContentProvider; } } return null; }
@Nullable protected static HtmlScriptContentProvider findScriptContentProvider(@Nullable String mimeType) { if (StringUtil.isEmpty(mimeType)) { return ourDefaultLanguage != null ? LanguageHtmlScriptContentProvider.getScriptContentProvider(ourDefaultLanguage) : null; } Collection<Language> instancesByMimeType = Language.findInstancesByMimeType(mimeType != null ? mimeType.trim() : null); for (Language language : instancesByMimeType) { HtmlScriptContentProvider scriptContentProvider = LanguageHtmlScriptContentProvider.getScriptContentProvider(language); if (scriptContentProvider != null) { return scriptContentProvider; } } return null; }