Examples of PsiAnnotation


Examples of com.intellij.psi.PsiAnnotation

  }

  @Nullable
  public static SubscriberMetadata getSubscriberMetadata(PsiMethod method) {
    for (SubscriberMetadata info : subscribers) {
      PsiAnnotation annotation = PsiConsultantImpl.findAnnotationOnMethod(method,
          info.getSubscriberAnnotationClassName());

      if (annotation != null) {
        return info;
      }
View Full Code Here

Examples of com.intellij.psi.PsiAnnotation

    for (SubscriberMetadata info : subscribers) {
      if (info.getProducerClassName() == null) {
        continue;
      }

      PsiAnnotation annotation = PsiConsultantImpl.findAnnotationOnMethod(method,
          info.getProducerClassName());

      if (annotation != null) {
        return true;
      }
View Full Code Here

Examples of com.intellij.psi.PsiAnnotation

      final PsiMethodCallExpression equalsCall = (PsiMethodCallExpression) factory.createExpressionFromText("a.equals(b)", null);
*/
      final PsiElementFactory factory = JavaPsiFacade.getInstance(project).getElementFactory();
      //final PsiAnnotation annotation = factory.createAnnotationFromText("@SomeAnnotation(someVariable = true)", descriptor.getPsiElement());
      //final PsiAnnotation annotation = factory.createAnnotationFromText("@" + _annotation + "({" + _bugType + "})", descriptor.getPsiElement().getContext());
      final PsiAnnotation annotation = factory.createAnnotationFromText('@' + _annotation + "({\"" + _bugType + "\"})\r\n", descriptor.getPsiElement());
      //factory.createImportStatement()
      descriptor.getPsiElement().addBefore(annotation, descriptor.getStartElement());

      /*equalsCall.getMethodExpression().getQualifierExpression().replace(lExpr);
      equalsCall.getArgumentList().getExpressions()[0].replace(rExpr);
 
View Full Code Here

Examples of com.intellij.psi.PsiAnnotation

  }


  @SuppressWarnings("HardcodedLineSeparator")
  public void addSuppressAnnotation(final Project project, final Editor editor, final PsiElement container, final PsiModifierList modifierList, final String id) throws IncorrectOperationException {
    PsiAnnotation annotation = modifierList.findAnnotation(_suppressWarningsClassName);
    if (annotation != null) {
      if (!annotation.getText().contains("{")) {
        final PsiNameValuePair[] attributes = annotation.getParameterList().getAttributes();
        if (attributes.length == 1) {
          final String suppressedWarnings = attributes[0].getText();
          final PsiAnnotation newAnnotation = JavaPsiFacade.getInstance(project).getElementFactory().createAnnotationFromText('@' + _suppressWarningsClassName + "({" + suppressedWarnings + ", \"" + id + "\"})\r\n", container);
          annotation.replace(newAnnotation);
        }
      } else {
        final int curlyBraceIndex = annotation.getText().lastIndexOf('}');
        if (curlyBraceIndex > 0) {
View Full Code Here

Examples of com.intellij.psi.PsiAnnotation

    private StepTextMatcher primaryAnnotationStepTextMatcher() {
        return stepTextMatcherFor(primaryPsiAnnotation);
    }

    private StepTextMatcher aliasAnnotationStepTextMatcher() {
        PsiAnnotation aliasPsiAnnotation = psiMethod.getModifierList().findAnnotation("org.jbehave.core.annotations.Alias");
        return stepTextMatcherFor(aliasPsiAnnotation);
    }
View Full Code Here

Examples of com.intellij.psi.PsiAnnotation

        PsiAnnotation aliasPsiAnnotation = psiMethod.getModifierList().findAnnotation("org.jbehave.core.annotations.Alias");
        return stepTextMatcherFor(aliasPsiAnnotation);
    }

    private StepTextMatcher aliasesAnnotationStepTextMatcher() {
        PsiAnnotation aliasesPsiAnnotation = psiMethod.getModifierList().findAnnotation("org.jbehave.core.annotations.Aliases");
        return stepTextMatcherFor(aliasesPsiAnnotation);
    }
View Full Code Here

Examples of com.intellij.psi.PsiAnnotation

  @Override
  @NotNull
  public PsiAnnotation addAnnotation(@NotNull @NonNls String qualifiedName) {
    final PsiElementFactory elementFactory = JavaPsiFacade.getInstance(getProject()).getElementFactory();
    final PsiAnnotation psiAnnotation = elementFactory.createAnnotationFromText('@' + qualifiedName, null);
    myAnnotations.put(qualifiedName, psiAnnotation);
    return psiAnnotation;
  }
View Full Code Here

Examples of com.intellij.psi.PsiAnnotation

  @Override
  @NotNull
  public PsiAnnotation addAnnotation(@NotNull @NonNls String qualifiedName) {
    final PsiElementFactory elementFactory = JavaPsiFacade.getInstance(getProject()).getElementFactory();
    final PsiAnnotation psiAnnotation = elementFactory.createAnnotationFromText('@' + qualifiedName, null);
    myAnnotations.put(qualifiedName, psiAnnotation);
    return psiAnnotation;
  }
View Full Code Here

Examples of com.intellij.psi.PsiAnnotation

  @Override
  @NotNull
  public PsiAnnotation addAnnotation(@NotNull @NonNls String qualifiedName) {
    final PsiElementFactory elementFactory = JavaPsiFacade.getInstance(getProject()).getElementFactory();
    final PsiAnnotation psiAnnotation = elementFactory.createAnnotationFromText('@' + qualifiedName, null);
    myAnnotations.put(qualifiedName, psiAnnotation);
    return psiAnnotation;
  }
View Full Code Here

Examples of com.intellij.psi.PsiAnnotation

  @Override
  @NotNull
  public PsiAnnotation addAnnotation(@NotNull @NonNls String qualifiedName) {
    final PsiElementFactory elementFactory = JavaPsiFacade.getInstance(getProject()).getElementFactory();
    final PsiAnnotation psiAnnotation = elementFactory.createAnnotationFromText('@' + qualifiedName, null);
    myAnnotations.put(qualifiedName, psiAnnotation);
    return psiAnnotation;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.