private static <T> DataValidator<T> getValidator(String dataId) { if (!ourExtensionsLoaded) { ourExtensionsLoaded = true; for (KeyedLazyInstanceEP<DataValidator> ep : Extensions.getExtensions(EP_NAME)) { ourValidators.put(ep.key, ep.getInstance()); } } return ourValidators.get(dataId); }
@Nullable private GetDataRule getRuleFromMap(@NotNull String dataId) { GetDataRule rule = myDataConstantToRuleMap.get(dataId); if (rule == null && !myDataConstantToRuleMap.containsKey(dataId)) { final KeyedLazyInstanceEP<GetDataRule>[] eps = Extensions.getExtensions(GetDataRule.EP_NAME); for(KeyedLazyInstanceEP<GetDataRule> ruleEP: eps) { if (ruleEP.key.equals(dataId)) { rule = ruleEP.getInstance(); } } myDataConstantToRuleMap.put(dataId, rule); } return rule; }
@Override public void createFileTypes(@NotNull FileTypeConsumer consumer) { consumer.consume(VisualStudioSolutionFileType.INSTANCE); for(KeyedLazyInstanceEP<VisualStudioLanguageImportProvider> ep : VisualStudioLanguageImportProvider.EP_NAME.getExtensions()) { consumer.consume(VisualStudioProjectFileType.INSTANCE, ep.getKey()); } }