Package com.intellij.psi

Examples of com.intellij.psi.PsiTypeElement


    if (element instanceof PsiMethod) {
      PsiMethod methodElement = (PsiMethod) element;

      // Does it have an @Provides?
      if (hasAnnotation(element, CLASS_PROVIDES)) {
        PsiTypeElement returnTypeElement = methodElement.getReturnTypeElement();
        if (returnTypeElement != null) {
          return new LineMarkerInfo<PsiElement>(element, returnTypeElement.getTextRange(), ICON,
              UPDATE_ALL, null, new ProvidesToInjectHandler(), LEFT);
        }
      }

      // Is it an @Inject-able constructor?
View Full Code Here


      // Not a method, is it a Field?
    } else if (element instanceof PsiField) {
      // Field injection.
      PsiField fieldElement = (PsiField) element;
      PsiTypeElement typeElement = fieldElement.getTypeElement();

      if (PsiConsultantImpl.hasAnnotation(element, CLASS_INJECT) && typeElement != null) {
        return new LineMarkerInfo<PsiElement>(element, typeElement.getTextRange(), ICON, UPDATE_ALL,
            null, new FieldInjectToProvidesHandler(), LEFT);
      }
    }

    return null;
View Full Code Here

      }
    });
  }

  private void maybeAddSubscriberMethod(PsiMethod element) {
    PsiTypeElement methodParameter = OttoLineMarkerProvider.getMethodParameter(element);
    if (methodParameter != null) {
      String canonicalText = methodParameter.getType().getCanonicalText();
      PsiFile containingFile = methodParameter.getContainingFile();
      if (containingFile != null) {
        VirtualFile virtualFile = containingFile.getVirtualFile();
        if (virtualFile != null) {
          synchronized (fileToEventClasses) {
            Set<String> eventClasses = getEventClasses(virtualFile);
View Full Code Here

  @Nullable @Override public LineMarkerInfo getLineMarkerInfo(@NotNull final PsiElement element) {
    if (element instanceof PsiMethod) {
      PsiMethod psiMethod = (PsiMethod) element;
      SubscriberMetadata subscriberMetadata = SubscriberMetadata.getSubscriberMetadata(psiMethod);
      if (subscriberMetadata != null) {
        PsiTypeElement methodParameter = getMethodParameter(psiMethod);
        if (methodParameter != null) {
          return new LineMarkerInfo<PsiElement>(psiMethod, methodParameter.getTextRange(), ICON,
              Pass.UPDATE_ALL, null, SHOW_INSTANTIATIONS_AND_PRODUCERS,
              GutterIconRenderer.Alignment.LEFT);
        }
      }
View Full Code Here

      Object elementValue = ((PsiLiteralExpression) psiElement).getValue();
      if (null != elementValue && asClass.isAssignableFrom(elementValue.getClass())) {
        value = (T) elementValue;
      }
    } else if (psiElement instanceof PsiClassObjectAccessExpression) {
      PsiTypeElement elementValue = ((PsiClassObjectAccessExpression) psiElement).getOperand();
      //Enums are supported as VALUE-Strings only
      if (asClass.isAssignableFrom(PsiType.class)) {
        value = (T) elementValue.getType();
      }
    }
    return value;
  }
View Full Code Here

      Object elementValue = ((PsiLiteralExpression) psiElement).getValue();
      if (null != elementValue && asClass.isAssignableFrom(elementValue.getClass())) {
        value = (T) elementValue;
      }
    } else if (psiElement instanceof PsiClassObjectAccessExpression) {
      PsiTypeElement elementValue = ((PsiClassObjectAccessExpression) psiElement).getOperand();
      //Enums are supported as VALUE-Strings only
      if (asClass.isAssignableFrom(PsiType.class)) {
        value = (T) elementValue.getType();
      }
    }
    return value;
  }
View Full Code Here

      Object elementValue = ((PsiLiteralExpression) psiElement).getValue();
      if (null != elementValue && asClass.isAssignableFrom(elementValue.getClass())) {
        value = (T) elementValue;
      }
    } else if (psiElement instanceof PsiClassObjectAccessExpression) {
      PsiTypeElement elementValue = ((PsiClassObjectAccessExpression) psiElement).getOperand();
      //Enums are supported as VALUE-Strings only
      if (asClass.isAssignableFrom(PsiType.class)) {
        value = (T) elementValue.getType();
      }
    }
    return value;
  }
View Full Code Here

      Object elementValue = ((PsiLiteralExpression) psiElement).getValue();
      if (null != elementValue && asClass.isAssignableFrom(elementValue.getClass())) {
        value = (T) elementValue;
      }
    } else if (psiElement instanceof PsiClassObjectAccessExpression) {
      PsiTypeElement elementValue = ((PsiClassObjectAccessExpression) psiElement).getOperand();
      //Enums are supported as VALUE-Strings only
      if (asClass.isAssignableFrom(PsiType.class)) {
        value = (T) elementValue.getType();
      }
    }
    return value;
  }
View Full Code Here

TOP

Related Classes of com.intellij.psi.PsiTypeElement

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.