Package de.plushnikov.intellij.plugin.psi

Examples of de.plushnikov.intellij.plugin.psi.LombokLightFieldBuilder


    final Project project = psiClass.getProject();
    final PsiManager manager = psiClass.getContainingFile().getManager();

    final PsiElementFactory psiElementFactory = JavaPsiFacade.getElementFactory(project);
    PsiType psiLoggerType = psiElementFactory.createTypeFromText(loggerType, psiClass);
    LombokLightFieldBuilder loggerField = new LombokLightFieldBuilder(manager, loggerName, psiLoggerType)
        .withContainingClass(psiClass)
        .withModifier(PsiModifier.FINAL).withModifier(PsiModifier.STATIC).withModifier(PsiModifier.PRIVATE)
        .withNavigationElement(psiAnnotation);

    final String loggerInitializerParameter = createLoggerInitializeParameter(psiClass, psiAnnotation);
    final PsiExpression initializer = psiElementFactory.createExpressionFromText(String.format(loggerInitializer, loggerInitializerParameter), psiClass);
    loggerField.setInitializer(initializer);
    return loggerField;
  }
View Full Code Here


        createField &= !psiField.getName().startsWith(LombokUtils.LOMBOK_INTERN_FIELD_MARKER);
        // skip initialized final fields
        createField &= !(null != psiField.getInitializer() && modifierList.hasModifierProperty(PsiModifier.FINAL));
      }
      if (createField) {
        fields.add(new LombokLightFieldBuilder(psiManager, psiField.getName(), psiField.getType())
            .withModifier(PsiModifier.PRIVATE));
      }
    }
    return fields;
  }
View Full Code Here

    List<PsiField> fields = new ArrayList<PsiField>();
    for (PsiParameter psiParameter : psiMethod.getParameterList().getParameters()) {
      final String parameterName = psiParameter.getName();
      if (null != parameterName) {
        fields.add(
            new LombokLightFieldBuilder(psiManager, parameterName, psiParameter.getType())
                .withModifier(PsiModifier.PRIVATE)
                .withContainingClass(psiMethod.getContainingClass()));
      }
    }
    return fields;
View Full Code Here

TOP

Related Classes of de.plushnikov.intellij.plugin.psi.LombokLightFieldBuilder

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.