Package com.intellij.psi

Examples of com.intellij.psi.PsiModifierList.addAnnotation()


    PsiModifierList methodParameterModifierList = methodParameter.getModifierList();
    if (null != methodParameterModifierList) {
      final Collection<String> annotationsToCopy = PsiAnnotationUtil.collectAnnotationsToCopy(psiField,
          LombokConstants.NON_NULL_PATTERN, LombokConstants.NULLABLE_PATTERN);
      for (String annotationFQN : annotationsToCopy) {
        methodParameterModifierList.addAnnotation(annotationFQN);
      }
    }

    return method;
View Full Code Here


    PsiModifierList methodParameterModifierList = method.getModifierList();
    final Collection<String> annotationsToCopy = PsiAnnotationUtil.collectAnnotationsToCopy(psiField,
        LombokConstants.NON_NULL_PATTERN, LombokConstants.NULLABLE_PATTERN);
    for (String annotationFQN : annotationsToCopy) {
      methodParameterModifierList.addAnnotation(annotationFQN);
    }
    return method;
  }

}
View Full Code Here

    PsiModifierList methodParameterModifierList = methodParameter.getModifierList();
    if (null != methodParameterModifierList) {
      final Collection<String> annotationsToCopy = PsiAnnotationUtil.collectAnnotationsToCopy(psiField,
          LombokUtils.NON_NULL_PATTERN, LombokUtils.NULLABLE_PATTERN);
      for (String annotationFQN : annotationsToCopy) {
        methodParameterModifierList.addAnnotation(annotationFQN);
      }
    }

    copyAnnotations(psiField, method.getModifierList(), LombokUtils.DEPRECATED_PATTERN);
View Full Code Here

    PsiModifierList methodParameterModifierList = method.getModifierList();
    final Collection<String> annotationsToCopy = PsiAnnotationUtil.collectAnnotationsToCopy(psiField,
        LombokUtils.NON_NULL_PATTERN, LombokUtils.NULLABLE_PATTERN);
    for (String annotationFQN : annotationsToCopy) {
      methodParameterModifierList.addAnnotation(annotationFQN);
    }
    return method;
  }

}
View Full Code Here

      if (annotation != null) {
        annotation.delete();
      }
    }

    PsiAnnotation inserted = modifierList.addAnnotation(myAnnotation);
    for (PsiNameValuePair pair : myPairs) {
      inserted.setDeclaredAttributeValue(pair.getName(), pair.getValue());
    }
    JavaCodeStyleManager.getInstance(project).shortenClassReferences(inserted);
    if (containingFile != file) {
View Full Code Here

      PsiMethod psiMethod = PropertyUtil.findPropertyGetter(psiField.getContainingClass(), psiField.getName(), false, false);

      if (null != psiMethod) {
        PsiModifierList modifierList = psiField.getModifierList();
        if (null != modifierList) {
          PsiAnnotation psiAnnotation = modifierList.addAnnotation(Getter.class.getName());
//          psiAnnotation.setDeclaredAttributeValue("value", )

          psiMethod.delete();
        }
      }
View Full Code Here

    final PsiModifierList fromMethodModifierList = fromMethod.getModifierList();
    final PsiModifierList resultMethodModifierList = resultMethod.getModifierList();
    copyModifiers(fromMethodModifierList, resultMethodModifierList);
    for (PsiAnnotation psiAnnotation : fromMethodModifierList.getAnnotations()) {
      final PsiAnnotation annotation = resultMethodModifierList.addAnnotation(psiAnnotation.getQualifiedName());
      for (PsiNameValuePair nameValuePair : psiAnnotation.getParameterList().getAttributes()) {
        annotation.setDeclaredAttributeValue(nameValuePair.getName(), nameValuePair.getValue());
      }
    }
View Full Code Here

      PsiField psiField = (PsiField) elementClassMember.getPsiElement();
      PsiMethod psiMethod = PropertyUtil.findPropertySetter(psiField.getContainingClass(), psiField.getName(), false, false);
      if (null != psiMethod) {
        PsiModifierList modifierList = psiField.getModifierList();
        if (null != modifierList) {
          PsiAnnotation psiAnnotation = modifierList.addAnnotation(Setter.class.getName());

          psiMethod.delete();
        }
      }
    }
View Full Code Here

    PsiModifierList methodParameterModifierList = methodParameter.getModifierList();
    if (null != methodParameterModifierList) {
      final Collection<String> annotationsToCopy = PsiAnnotationUtil.collectAnnotationsToCopy(psiField,
          LombokUtils.NON_NULL_PATTERN, LombokUtils.NULLABLE_PATTERN);
      for (String annotationFQN : annotationsToCopy) {
        methodParameterModifierList.addAnnotation(annotationFQN);
      }
    }

    final String thisOrClass = isStatic ? psiClass.getName() : "this";
    String blockText = String.format("%s.%s = %s;", thisOrClass, psiField.getName(), methodParameter.getName());
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.