Java 类com.intellij.psi.util.PsiMethodUtil 实例源码

项目:intellij-ce-playground    文件:GenerateMainAction.java   
private static boolean isActionEnabled(final AnActionEvent e) {
  Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) return false;
  Editor editor = e.getData(CommonDataKeys.EDITOR);
  if (editor == null) return false;
  int offset = editor.getCaretModel().getOffset();
  PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
  if (file == null) return false;
  PsiElement element = file.findElementAt(offset);
  if (element == null) return false;
  PsiClass psiClass = PsiTreeUtil.getParentOfType(element, PsiClass.class);
  if (psiClass == null) return false;
  if (PsiMethodUtil.findMainMethod(psiClass) != null) return false;
  if (FormClassIndex.findFormsBoundToClass(project, psiClass).isEmpty()) return false;
  return true;
}
项目:tools-idea    文件:GenerateMainAction.java   
private static boolean isActionEnabled(final AnActionEvent e) {
  Project project = e.getData(PlatformDataKeys.PROJECT);
  if (project == null) return false;
  Editor editor = e.getData(PlatformDataKeys.EDITOR);
  if (editor == null) return false;
  int offset = editor.getCaretModel().getOffset();
  PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
  if (file == null) return false;
  PsiElement element = file.findElementAt(offset);
  if (element == null) return false;
  PsiClass psiClass = PsiTreeUtil.getParentOfType(element, PsiClass.class);
  if (psiClass == null) return false;
  if (PsiMethodUtil.findMainMethod(psiClass) != null) return false;
  if (FormClassIndex.findFormsBoundToClass(psiClass).isEmpty()) return false;
  return true;
}
项目:consulo-ui-designer    文件:GenerateMainAction.java   
private static boolean isActionEnabled(final AnActionEvent e) {
  Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) return false;
  Editor editor = e.getData(PlatformDataKeys.EDITOR);
  if (editor == null) return false;
  int offset = editor.getCaretModel().getOffset();
  PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
  if (file == null) return false;
  PsiElement element = file.findElementAt(offset);
  if (element == null) return false;
  PsiClass psiClass = PsiTreeUtil.getParentOfType(element, PsiClass.class);
  if (psiClass == null) return false;
  if (PsiMethodUtil.findMainMethod(psiClass) != null) return false;
  if (FormClassIndex.findFormsBoundToClass(psiClass).isEmpty()) return false;
  return true;
}
项目:consulo-java    文件:ApplicationRunLineMarkerProvider.java   
@Nullable
@Override
public Info getInfo(final PsiElement e)
{
    if(isIdentifier(e))
    {
        PsiElement element = e.getParent();
        if(element instanceof PsiClass && PsiMethodUtil.findMainInClass((PsiClass) element) != null || element instanceof PsiMethod && "main".equals(((PsiMethod) element).getName()) &&
                PsiMethodUtil.isMainMethod((PsiMethod) element))
        {
            final AnAction[] actions = ExecutorAction.getActions(0);
            return new Info(AllIcons.RunConfigurations.TestState.Run, element1 -> StringUtil.join(ContainerUtil.mapNotNull(actions, action -> getText(action, element1)), "\n"), actions);
        }
    }
    return null;
}
项目:consulo-java    文件:AbstractApplicationConfigurationProducer.java   
@Nullable
private static PsiMethod findMain(PsiElement element)
{
    PsiMethod method;
    while((method = PsiTreeUtil.getParentOfType(element, PsiMethod.class)) != null)
    {
        if(PsiMethodUtil.isMainMethod(method))
        {
            return method;
        }
        else
        {
            element = method.getParent();
        }
    }
    return null;
}
项目:livingdoc-intellij    文件:RunConfigurationEditor.java   
private void createUIComponents() {
    myMainClass = new LabeledComponent<>();
    myMainClass.setComponent(new EditorTextFieldWithBrowseButton(myProject, true, (declaration, place) -> {

        if (declaration instanceof PsiClass) {
            final PsiClass aClass = (PsiClass) declaration;
            if (ConfigurationUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.findMainMethod(aClass) != null) {
                return JavaCodeFragment.VisibilityChecker.Visibility.VISIBLE;
            }
        }
        return JavaCodeFragment.VisibilityChecker.Visibility.NOT_VISIBLE;
    }
    ));
}
项目:intellij-ce-playground    文件:UnusedDeclarationInspectionBase.java   
public boolean isEntryPoint(@NotNull PsiElement element) {
  final Project project = element.getProject();
  final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
  if (element instanceof PsiMethod && isAddMainsEnabled() && PsiClassImplUtil.isMainOrPremainMethod((PsiMethod)element)) {
    return true;
  }
  if (element instanceof PsiClass) {
    PsiClass aClass = (PsiClass)element;
    final PsiClass applet = psiFacade.findClass("java.applet.Applet", GlobalSearchScope.allScope(project));
    if (isAddAppletEnabled() && applet != null && aClass.isInheritor(applet, true)) {
      return true;
    }

    final PsiClass servlet = psiFacade.findClass("javax.servlet.Servlet", GlobalSearchScope.allScope(project));
    if (isAddServletEnabled() && servlet != null && aClass.isInheritor(servlet, true)) {
      return true;
    }
    if (isAddMainsEnabled() && PsiMethodUtil.hasMainMethod(aClass)) return true;
  }
  if (element instanceof PsiModifierListOwner) {
    final EntryPointsManager entryPointsManager = EntryPointsManager.getInstance(project);
    if (entryPointsManager.isEntryPoint(element)) return true;
  }
  for (EntryPoint extension : myExtensions) {
    if (extension.isEntryPoint(element)) {
      return true;
    }
  }
  final ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
  for (ImplicitUsageProvider provider : implicitUsageProviders) {
    if (provider.isImplicitUsage(element)) return true;
  }
  return false;
}
项目:intellij-ce-playground    文件:ClassReferenceParser.java   
protected boolean checkClass(@NotNull HeaderValuePart valuePart, @NotNull PsiClass aClass, @NotNull AnnotationHolder holder) {
  if (!PsiMethodUtil.hasMainMethod(aClass)) {
    holder.createErrorAnnotation(valuePart.getHighlightingRange(), ManifestBundle.message("header.main.class.invalid"));
    return true;
  }

  return false;
}
项目:intellij-ce-playground    文件:ApplicationConfiguration.java   
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
  JavaParametersUtil.checkAlternativeJRE(this);
  final JavaRunConfigurationModule configurationModule = getConfigurationModule();
  final PsiClass psiClass = configurationModule.checkModuleAndClassName(MAIN_CLASS_NAME, ExecutionBundle.message("no.main.class.specified.error.text"));
  if (!PsiMethodUtil.hasMainMethod(psiClass)) {
    throw new RuntimeConfigurationWarning(ExecutionBundle.message("main.method.not.found.in.class.error.message", MAIN_CLASS_NAME));
  }
  ProgramParametersUtil.checkWorkingDirectoryExist(this, getProject(), configurationModule.getModule());
  JavaRunConfigurationExtensionManager.checkConfigurationIsValid(this);
}
项目:intellij-ce-playground    文件:ApplicationConfigurable.java   
private void createUIComponents() {
  myMainClass = new LabeledComponent<EditorTextFieldWithBrowseButton>();
  myMainClass.setComponent(new EditorTextFieldWithBrowseButton(myProject, true, new JavaCodeFragment.VisibilityChecker() {
    @Override
    public Visibility isDeclarationVisible(PsiElement declaration, PsiElement place) {
      if (declaration instanceof PsiClass) {
        final PsiClass aClass = (PsiClass)declaration;
        if (ConfigurationUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.findMainMethod(aClass) != null || place.getParent() != null && myModuleSelector.findClass(((PsiClass)declaration).getQualifiedName()) != null) {
          return Visibility.VISIBLE;
        }
      }
      return Visibility.NOT_VISIBLE;
    }
  }));
}
项目:intellij-ce-playground    文件:ApplicationRunLineMarkerProvider.java   
@Nullable
@Override
public Info getInfo(PsiElement e) {
  if (isIdentifier(e)) {
    PsiElement element = e.getParent();
    if (element instanceof PsiClass && PsiMethodUtil.findMainInClass((PsiClass)element) != null)
      return new Info(ApplicationConfigurationType.getInstance().getIcon(), null, ExecutorAction.getActions(0));
    if (element instanceof PsiMethod && "main".equals(((PsiMethod)element).getName()) && PsiMethodUtil.isMainMethod((PsiMethod)element))
      return new Info(ApplicationConfigurationType.getInstance().getIcon(), null, ExecutorAction.getActions(0));
  }
  return null;
}
项目:intellij-ce-playground    文件:ApplicationConfigurationProducer.java   
@Nullable
private static PsiMethod findMain(PsiElement element) {
  PsiMethod method;
  while ((method = PsiTreeUtil.getParentOfType(element, PsiMethod.class)) != null) {
    if (PsiMethodUtil.isMainMethod(method)) return method;
    else element = method.getParent();
  }
  return null;
}
项目:intellij-ce-playground    文件:ManifestFileUtil.java   
public boolean isAccepted(final PsiClass aClass) {
  return ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
    @Override
    public Boolean compute() {
      return PsiMethodUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.hasMainMethod(aClass);
    }
  });
}
项目:intellij-ce-playground    文件:SystemExitInspection.java   
@Override
public void visitMethodCallExpression(@NotNull PsiMethodCallExpression expression) {
  super.visitMethodCallExpression(expression);
  final PsiReferenceExpression methodExpression = expression.getMethodExpression();
  @NonNls final String methodName = methodExpression.getReferenceName();
  if (!"exit".equals(methodName) && !"halt".equals(methodName)) {
    return;
  }
  final PsiMethod containingMethod = PsiTreeUtil.getParentOfType(expression, PsiMethod.class, true, PsiClass.class, PsiLambdaExpression.class);
  if (ignoreInMainMethod && PsiMethodUtil.isMainMethod(containingMethod)) {
    return;
  }
  final PsiMethod method = expression.resolveMethod();
  if (method == null) {
    return;
  }
  final PsiParameterList parameterList = method.getParameterList();
  if (parameterList.getParametersCount() != 1) {
    return;
  }
  final PsiParameter[] parameters = parameterList.getParameters();
  final PsiType parameterType = parameters[0].getType();
  if (!parameterType.equals(PsiType.INT)) {
    return;
  }
  final PsiClass aClass = method.getContainingClass();
  if (aClass == null) {
    return;
  }
  final String className = aClass.getQualifiedName();
  if (!"java.lang.System".equals(className) && !"java.lang.Runtime".equals(className)) {
    return;
  }
  registerMethodCallError(expression, "System");
}
项目:intellij-ce-playground    文件:JavaFXApplicationMainMethodProvider.java   
@Override
public PsiMethod findMainInClass(PsiClass clazz) {
  final PsiMethod[] launches = clazz.findMethodsByName(LAUNCH_MAIN, true);
  for (PsiMethod launchMethod : launches) {
    if (PsiMethodUtil.isMainMethod(launchMethod)) {
      return launchMethod;
    }
  }
  return null;
}
项目:intellij    文件:BlazeJavaMainClassRunConfigurationProducer.java   
@Override
protected boolean doSetupConfigFromContext(
    BlazeCommandRunConfiguration configuration,
    ConfigurationContext context,
    Ref<PsiElement> sourceElement) {
  PsiClass mainClass = getMainClass(context);
  if (mainClass == null) {
    return false;
  }
  // Try setting source element to a main method so ApplicationConfigurationProducer
  // can't override our configuration by producing a more specific one.
  PsiMethod mainMethod = PsiMethodUtil.findMainMethod(mainClass);
  if (mainMethod == null) {
    sourceElement.set(mainClass);
  } else {
    sourceElement.set(mainMethod);
  }

  TargetIdeInfo target = getTarget(context.getProject(), mainClass);
  if (target == null) {
    return false;
  }
  configuration.setTargetInfo(target.toTargetInfo());
  BlazeCommandRunConfigurationCommonState handlerState =
      configuration.getHandlerStateIfType(BlazeCommandRunConfigurationCommonState.class);
  if (handlerState == null) {
    return false;
  }
  handlerState.getCommandState().setCommand(BlazeCommandName.RUN);
  configuration.setGeneratedName();
  return true;
}
项目:embeddedlinux-jvmdebugger-intellij    文件:RunConfigurationEditor.java   
/**
 * Creates UI Components
 */
private void createUIComponents() {
    myMainClass = new LabeledComponent<>();
    myMainClass.setComponent(new EditorTextFieldWithBrowseButton(myProject, true, (declaration, place) -> {
        if (declaration instanceof PsiClass) {
            final PsiClass aClass = (PsiClass)declaration;
            if (ConfigurationUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.findMainMethod(aClass) != null || place.getParent() != null && myModuleSelector.findClass(((PsiClass)declaration).getQualifiedName()) != null) {
                return JavaCodeFragment.VisibilityChecker.Visibility.VISIBLE;
            }
        }
        return JavaCodeFragment.VisibilityChecker.Visibility.NOT_VISIBLE;
    }));
}
项目:defrac-plugin-intellij    文件:DefracRunUtil.java   
@Nullable
public static PsiMethod findMainMethod(@Nullable PsiElement element) {
  PsiMethod method;
  while((method = PsiTreeUtil.getParentOfType(element, PsiMethod.class)) != null) {
    if(PsiMethodUtil.isMainMethod(method)) {
      return method;
    }

    element = method.getParent();
  }

  return null;
}
项目:tools-idea    文件:ApplicationConfiguration.java   
public void checkConfiguration() throws RuntimeConfigurationException {
  JavaParametersUtil.checkAlternativeJRE(this);
  final JavaRunConfigurationModule configurationModule = getConfigurationModule();
  final PsiClass psiClass = configurationModule.checkModuleAndClassName(MAIN_CLASS_NAME, ExecutionBundle.message("no.main.class.specified.error.text"));
  if (!PsiMethodUtil.hasMainMethod(psiClass)) {
    throw new RuntimeConfigurationWarning(ExecutionBundle.message("main.method.not.found.in.class.error.message", MAIN_CLASS_NAME));
  }
  ProgramParametersUtil.checkWorkingDirectoryExist(this, getProject(), configurationModule.getModule());
  JavaRunConfigurationExtensionManager.checkConfigurationIsValid(this);
}
项目:tools-idea    文件:ApplicationConfigurable.java   
private void createUIComponents() {
  myMainClass = new LabeledComponent<EditorTextFieldWithBrowseButton>();
  myMainClass.setComponent(new EditorTextFieldWithBrowseButton(myProject, true, new JavaCodeFragment.VisibilityChecker() {
    @Override
    public Visibility isDeclarationVisible(PsiElement declaration, PsiElement place) {
      if (declaration instanceof PsiClass) {
        final PsiClass aClass = (PsiClass)declaration;
        if (ConfigurationUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.findMainMethod(aClass) != null) {
          return Visibility.VISIBLE;
        }
      }
      return Visibility.NOT_VISIBLE;
    }
  }));
}
项目:tools-idea    文件:ApplicationConfigurationProducer.java   
@Nullable
private static PsiMethod findMain(PsiElement element) {
  PsiMethod method;
  while ((method = PsiTreeUtil.getParentOfType(element, PsiMethod.class)) != null) {
    if (PsiMethodUtil.isMainMethod(method)) return method;
    else element = method.getParent();
  }
  return null;
}
项目:tools-idea    文件:ManifestFileUtil.java   
public boolean isAccepted(final PsiClass aClass) {
  return ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
    @Override
    public Boolean compute() {
      return PsiMethodUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.hasMainMethod(aClass);
    }
  });
}
项目:tools-idea    文件:SystemExitInspection.java   
@Override
public void visitMethodCallExpression(@NotNull PsiMethodCallExpression expression) {
  super.visitMethodCallExpression(expression);
  final PsiReferenceExpression methodExpression = expression.getMethodExpression();
  @NonNls final String methodName = methodExpression.getReferenceName();
  if (!"exit".equals(methodName) && !"halt".equals(methodName)) {
    return;
  }
  final PsiMethod containingMethod = PsiTreeUtil.getParentOfType(expression, PsiMethod.class, true, PsiClass.class);
  if (ignoreInMainMethod && PsiMethodUtil.isMainMethod(containingMethod)) {
    return;
  }
  final PsiMethod method = expression.resolveMethod();
  if (method == null) {
    return;
  }
  final PsiParameterList parameterList = method.getParameterList();
  if (parameterList.getParametersCount() != 1) {
    return;
  }
  final PsiParameter[] parameters = parameterList.getParameters();
  final PsiType parameterType = parameters[0].getType();
  if (!parameterType.equals(PsiType.INT)) {
    return;
  }
  final PsiClass aClass = method.getContainingClass();
  if (aClass == null) {
    return;
  }
  final String className = aClass.getQualifiedName();
  if (!"java.lang.System".equals(className) && !"java.lang.Runtime".equals(className)) {
    return;
  }
  registerMethodCallError(expression, "System");
}
项目:consulo-ikvm    文件:IkvmModuleExtensionUtil.java   
@NotNull
public static PsiElement[] buildEntryPoints(@NotNull Module module)
{
    Query<PsiClass> search = AllClassesSearch.search(GlobalSearchScope.moduleScope(module), module.getProject());

    final List<PsiElement> list = new ArrayList<PsiElement>();
    search.forEach(psiClass -> {
        if(PsiMethodUtil.hasMainMethod(psiClass))
        {
            list.add(new IkvmJavaClassAsDotNetTypeElement(psiClass));
        }
        return true;
    });
    return ContainerUtil.toArray(list, PsiElement.ARRAY_FACTORY);
}
项目:consulo-java    文件:ApplicationConfiguration.java   
@Override
public void checkConfiguration() throws RuntimeConfigurationException
{
    JavaParametersUtil.checkAlternativeJRE(this);
    final JavaRunConfigurationModule configurationModule = getConfigurationModule();
    final PsiClass psiClass = configurationModule.checkModuleAndClassName(MAIN_CLASS_NAME, ExecutionBundle.message("no.main.class.specified.error.text"));
    if(!PsiMethodUtil.hasMainMethod(psiClass))
    {
        throw new RuntimeConfigurationWarning(ExecutionBundle.message("main.method.not.found.in.class.error.message", MAIN_CLASS_NAME));
    }
    ProgramParametersUtil.checkWorkingDirectoryExist(this, getProject(), configurationModule.getModule());
    JavaRunConfigurationExtensionManager.checkConfigurationIsValid(this);
}
项目:consulo-java    文件:ManifestFileUtil.java   
@Override
public boolean isAccepted(final PsiClass aClass)
{
    return ApplicationManager.getApplication().runReadAction(new Computable<Boolean>()
    {
        @Override
        public Boolean compute()
        {
            return PsiMethodUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.hasMainMethod(aClass);
        }
    });
}
项目:intellij-ce-playground    文件:GroovyRunnerPsiUtil.java   
public static boolean canBeRunByGroovy(final PsiClass psiClass) {
  return psiClass instanceof GroovyScriptClass ||
         isRunnable(psiClass) ||
         psiClass instanceof GrTypeDefinition && PsiMethodUtil.hasMainMethod(psiClass);
}
项目:MvnRunner    文件:MvnRunConfigurationProducer.java   
@Override
protected boolean isContext(ConfigurationContext context) {
    return super.isContext(context) && !isTestScope &&
            psiClass != null && PsiMethodUtil.hasMainMethod(psiClass);
}
项目:tools-idea    文件:UnusedDeclarationInspection.java   
public boolean isEntryPoint(@NotNull PsiElement element) {
  final Project project = element.getProject();
  final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
  if (element instanceof PsiMethod && isAddMainsEnabled() && PsiClassImplUtil.isMainOrPremainMethod((PsiMethod)element)) {
    return true;
  }
  if (element instanceof PsiClass) {
    PsiClass aClass = (PsiClass)element;
    /*
    if (aClass.isAnnotationType()) {
      return true;
    }

    if (aClass.isEnum()) {
      return true;
    }
    */
    final PsiClass applet = psiFacade.findClass("java.applet.Applet", GlobalSearchScope.allScope(project));
    if (isAddAppletEnabled() && applet != null && aClass.isInheritor(applet, true)) {
      return true;
    }

    final PsiClass servlet = psiFacade.findClass("javax.servlet.Servlet", GlobalSearchScope.allScope(project));
    if (isAddServletEnabled() && servlet != null && aClass.isInheritor(servlet, true)) {
      return true;
    }
    if (isAddMainsEnabled() && PsiMethodUtil.hasMainMethod(aClass)) return true;
  }
  if (element instanceof PsiModifierListOwner) {
    final EntryPointsManager entryPointsManager = EntryPointsManager.getInstance(project);
    if (entryPointsManager.isEntryPoint((PsiModifierListOwner)element)) return true;
    //if (AnnotationUtil
    //  .checkAnnotatedUsingPatterns((PsiModifierListOwner)element, entryPointsManager.ADDITIONAL_ANNOTATIONS) ||
    //  AnnotationUtil
    //  .checkAnnotatedUsingPatterns((PsiModifierListOwner)element, entryPointsManager.getAdditionalAnnotations())) {
    //  return true;
    //}
  }
  for (EntryPoint extension : myExtensions) {
    if (extension.isEntryPoint(element)) {
      return true;
    }
  }
  final ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
  for (ImplicitUsageProvider provider : implicitUsageProviders) {
    if (provider.isImplicitUsage(element)) return true;
  }
  return false;
}
项目:tools-idea    文件:GroovyRunnerUtil.java   
public static boolean canBeRunByGroovy(final PsiClass psiClass) {
  return psiClass instanceof GroovyScriptClass ||
         isRunnable(psiClass) ||
         psiClass instanceof GrTypeDefinition && PsiMethodUtil.hasMainMethod(psiClass);
}
项目:teavm    文件:TeaVMConfigurationPanel.java   
private boolean isMainClass(PsiClass cls) {
    return ApplicationManager.getApplication().runReadAction((Computable<Boolean>) () -> {
        return PsiMethodUtil.MAIN_CLASS.value(cls) && PsiMethodUtil.hasMainMethod(cls);
    });
}
项目:consulo-java    文件:UnusedDeclarationInspectionBase.java   
public boolean isEntryPoint(@NotNull PsiElement element)
{
    final Project project = element.getProject();
    final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
    if(element instanceof PsiMethod && isAddMainsEnabled() && PsiClassImplUtil.isMainOrPremainMethod((PsiMethod)
            element))
    {
        return true;
    }
    if(element instanceof PsiClass)
    {
        PsiClass aClass = (PsiClass) element;
        final PsiClass applet = psiFacade.findClass("java.applet.Applet", GlobalSearchScope.allScope(project));
        if(isAddAppletEnabled() && applet != null && aClass.isInheritor(applet, true))
        {
            return true;
        }

        final PsiClass servlet = psiFacade.findClass("javax.servlet.Servlet", GlobalSearchScope.allScope(project));
        if(isAddServletEnabled() && servlet != null && aClass.isInheritor(servlet, true))
        {
            return true;
        }
        if(isAddMainsEnabled() && PsiMethodUtil.hasMainMethod(aClass))
        {
            return true;
        }
    }
    if(element instanceof PsiModifierListOwner)
    {
        final EntryPointsManager entryPointsManager = EntryPointsManager.getInstance(project);
        if(entryPointsManager.isEntryPoint(element))
        {
            return true;
        }
    }
    for(EntryPoint extension : myExtensions)
    {
        if(extension.isEntryPoint(element))
        {
            return true;
        }
    }
    final ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
    for(ImplicitUsageProvider provider : implicitUsageProviders)
    {
        if(provider.isImplicitUsage(element))
        {
            return true;
        }
    }
    return false;
}