PsiField (@NotNull PsiField psiField, @NotNull PsiClass psiClass, @NotNull PsiAnnotation psiAnnotation) { final PsiManager manager = psiClass.getContainingFile().getManager(); final PsiType psiFieldType = PsiType.getJavaLangString(manager, GlobalSearchScope.allScope(psiClass.getProject())); final String fieldModifier = LombokProcessorUtil.getLevelVisibility(psiAnnotation); final String fieldName = calcFieldConstantName(psiField, psiAnnotation, psiClass); LombokLightFieldBuilder fieldNameConstant = new LombokLightFieldBuilder(manager, fieldName, psiFieldType) .withContainingClass(psiClass) .withNavigationElement(psiField) .withModifier(PsiModifier.STATIC) .withModifier(PsiModifier.FINAL); if (!PsiModifier.PACKAGE_LOCAL.equals(fieldModifier)) { fieldNameConstant.withModifier(fieldModifier); } final PsiElementFactory psiElementFactory = JavaPsiFacade.getElementFactory(psiClass.getProject()); final PsiExpression initializer = psiElementFactory.createExpressionFromText("\"" + psiField.getName() + "\"", psiClass); fieldNameConstant.setInitializer(initializer); return fieldNameConstant; }