Java 类com.intellij.util.KeyedLazyInstanceEP 实例源码

项目:intellij-ce-playground    文件:DataValidator.java   
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);
}
项目:intellij-ce-playground    文件:DataManagerImpl.java   
@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;
}
项目:consulo-visual-studio    文件:VisualStudioFileTypeFactory.java   
@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());
    }
}
项目:tools-idea    文件:DataValidator.java   
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);
}
项目:tools-idea    文件:DataManagerImpl.java   
@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;
}