void (@NotNull Project project, @NotNull PsiElement startElement, @NotNull ModPsiUpdater updater) { final PsiNameValuePair annotationParameter = (PsiNameValuePair)startElement; final String text = buildReplacementText(annotationParameter); final PsiElementFactory factory = JavaPsiFacade.getElementFactory(annotationParameter.getProject()); final PsiAnnotation newAnnotation = factory.createAnnotationFromText("@A(" + text + " )", annotationParameter); annotationParameter.replace(newAnnotation.getParameterList().getAttributes()[0]); }