Package com.intellij.psi

Examples of com.intellij.psi.JavaPsiFacade


      PsiModifierList modifierList = listOwner.getModifierList();

      if (modifierList != null) {
        for (PsiAnnotation psiAnnotation : modifierList.getAnnotations()) {
          if (psiAnnotation != null && psiAnnotation.getQualifiedName() != null) {
            JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(element.getProject());
            PsiClass psiClass = psiFacade.findClass(psiAnnotation.getQualifiedName(),
                GlobalSearchScope.projectScope(element.getProject()));

            if (hasAnnotation(psiClass, CLASS_QUALIFIER)) {
              qualifiedClasses.add(psiAnnotation.getQualifiedName());
            }
View Full Code Here


  private static PsiClass getPsiClass(PsiElement psiElement, PsiClass wrapperClass,
      PsiType psiFieldType) {
    PsiClassType psiClassType = (PsiClassType) psiFieldType;
    Project project = psiElement.getProject();
    JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(project);
    GlobalSearchScope globalSearchScope = GlobalSearchScope.allScope(project);

    PsiClass lazyClass = javaPsiFacade.findClass(CLASS_LAZY, globalSearchScope);
    PsiClass providerClass = javaPsiFacade.findClass(CLASS_PROVIDER, globalSearchScope);

    PsiClassType.ClassResolveResult classResolveResult = psiClassType.resolveGenerics();
    PsiClass outerClass = classResolveResult.getElement();

    // If Lazy<Foo> or Provider<Foo>, extract Foo as the interesting type.
View Full Code Here

     */
    public static boolean isLibraryPresent(@Nullable Module module) {
        if (module == null) {
            return false;
        }
        JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(module.getProject());
        return psiFacade.findClass(Constants.WICKET_COMPONENT, WicketSearchScope.classInModuleWithDependenciesAndLibraries(module)) != null;
    }
View Full Code Here

      performSearch(projectScope, subscriberMetadata.getSubscriberAnnotationClassName());
    }
  }

  private void performSearch(final SearchScope searchScope, final String subscribeClassName) {
    JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(myProject);
    PsiClass subscribePsiClass = javaPsiFacade.findClass(subscribeClassName,
        GlobalSearchScope.allScope(myProject));
    if (subscribePsiClass == null) {
      // the guava or otto library isn't available in this project so do nothing
      return;
    }
View Full Code Here

      public void run() {
        Set<String> eventClasses;
        synchronized (allEventClasses) {
          eventClasses = new HashSet<String>(allEventClasses);
        }
        JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(myProject);
        DaemonCodeAnalyzer codeAnalyzer = DaemonCodeAnalyzer.getInstance(myProject);
        for (String eventClass : eventClasses) {
          PsiClass eventPsiClass = javaPsiFacade.findClass(eventClass,
                GlobalSearchScope.allScope(myProject));
          if (eventPsiClass == null) continue;
          PsiFile psiFile = eventPsiClass.getContainingFile();
          if (psiFile == null) continue;
          codeAnalyzer.restart(psiFile);
View Full Code Here

    return displayedTypesOnSubscriberMethods;
  }

  @Nullable
  public PsiMethod getBusPostMethod(Project project) {
    JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(project);
    GlobalSearchScope globalSearchScope = GlobalSearchScope.allScope(project);

    PsiClass busClass = javaPsiFacade.findClass(getBusClassName(), globalSearchScope);
    if (busClass != null) {
      for (PsiMethod psiMethod : busClass.getMethods()) {
        if (psiMethod.getName().equals("post")) {
          return psiMethod;
        }
View Full Code Here

  }

  @Nullable
  private static VirtualFile getStrutsJarRoot(final Module module) throws IOException {
    final GlobalSearchScope scope = GlobalSearchScope.moduleRuntimeScope(module, false);
    final JavaPsiFacade psiManager = JavaPsiFacade.getInstance(module.getProject());

    final VirtualFile virtualFile = getStrutsClass(scope, psiManager);
    if (virtualFile == null || !(virtualFile.getFileSystem() instanceof JarFileSystem)) {
      return null;
    }
View Full Code Here

  };

  @NotNull
  public Collection<TilesModel> computeModels(@NotNull final Module module) {
    final Project project = module.getProject();
    final JavaPsiFacade facade = JavaPsiFacade.getInstance(project);
    final GlobalSearchScope moduleScope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module, false);

    // struts2-tiles plugin must be available
    final PsiClass strutsTilesListenerClass = facade.findClass(STRUTS_TILES_LISTENER_CLASS,
                                                               moduleScope);
    if (strutsTilesListenerClass == null) {
      return Collections.emptyList();
    }

    final PsiClass tilesListenerClass = facade.findClass(TilesConstants.TILES_LISTENER, moduleScope);

    final StrutsPluginDomFactory<TilesDefinitions, TilesModel> factory =
        StrutsProjectComponent.getInstance(project).getTilesFactory();

    final Set<TilesModel> struts2TilesModels = new HashSet<TilesModel>();
View Full Code Here

  protected boolean checkClass(@NotNull PsiReference reference, @NotNull PsiElement element, @NotNull AnnotationHolder holder) {
    if (element instanceof PsiClass) {
      Module module = ModuleUtilCore.findModuleForPsiElement(element);
      if (module != null) {
        GlobalSearchScope scope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module);
        JavaPsiFacade facade = JavaPsiFacade.getInstance(element.getProject());
        PsiClass activatorClass = facade.findClass("org.osgi.framework.BundleActivator", scope);
        if (activatorClass != null && ((PsiClass)element).isInheritor(activatorClass, true)) {
          return false;
        }
      }
    }
View Full Code Here

    return getSimpleVersionFromMainClass(module);
  }

  private static String getSimpleVersionFromMainClass(Module module) {
    final JavaPsiFacade facade = JavaPsiFacade.getInstance(module.getProject());

    final PsiClass oldMain = facade.findClass(CUCUMBER_CLI_MAIN_1_0, module.getModuleWithLibrariesScope());
    if (oldMain != null) return CUCUMBER_VERSION_1_0;

    final PsiClass newMain = facade.findClass(CUCUMBER_API_CLI_MAIN_1_1, module.getModuleWithLibrariesScope());
    if (newMain != null) return CUCUMBER_VERSION_1_1;

    return null;
  }
View Full Code Here

TOP

Related Classes of com.intellij.psi.JavaPsiFacade

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.