lombok.experimental.UtilityClass Java Examples
The following examples show how to use
lombok.experimental.UtilityClass.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UtilityClassModifierProcessor.java From lombok-intellij-plugin with BSD 3-Clause "New" or "Revised" License | 6 votes |
public static boolean isModifierListSupported(@NotNull PsiModifierList modifierList) { PsiElement modifierListParent = modifierList.getParent(); if (modifierListParent instanceof PsiClass) { PsiClass parentClass = (PsiClass) modifierListParent; if (PsiAnnotationSearchUtil.isAnnotatedWith(parentClass, UtilityClass.class)) { return UtilityClassProcessor.validateOnRightType(parentClass, new ProblemNewBuilder()); } } if (!isElementFieldOrMethodOrInnerClass(modifierListParent)) { return false; } PsiClass searchableClass = PsiTreeUtil.getParentOfType(modifierListParent, PsiClass.class, true); return null != searchableClass && PsiAnnotationSearchUtil.isAnnotatedWith(searchableClass, UtilityClass.class) && UtilityClassProcessor.validateOnRightType(searchableClass, new ProblemNewBuilder()); }
Example #2
Source File: UtilityClassModifierProcessor.java From lombok-intellij-plugin with BSD 3-Clause "New" or "Revised" License | 6 votes |
@Override public void transformModifiers(@NotNull PsiModifierList modifierList, @NotNull final Set<String> modifiers) { final PsiElement parent = modifierList.getParent(); // FINAL if (parent instanceof PsiClass) { PsiClass psiClass = (PsiClass) parent; if (PsiAnnotationSearchUtil.isAnnotatedWith(psiClass, UtilityClass.class)) { modifiers.add(PsiModifier.FINAL); } } // STATIC if (isElementFieldOrMethodOrInnerClass(parent)) { modifiers.add(PsiModifier.STATIC); } }
Example #3
Source File: HandleUtilityClass.java From EasyMPermission with MIT License | 5 votes |
@Override public void handle(AnnotationValues<UtilityClass> annotation, Annotation ast, EclipseNode annotationNode) { handleFlagUsage(annotationNode, ConfigurationKeys.UTLITY_CLASS_FLAG_USAGE, "@UtilityClass"); EclipseNode typeNode = annotationNode.up(); if (!checkLegality(typeNode, annotationNode)) return; changeModifiersAndGenerateConstructor(annotationNode.up(), annotationNode); }
Example #4
Source File: HandleUtilityClass.java From EasyMPermission with MIT License | 5 votes |
@Override public void handle(AnnotationValues<UtilityClass> annotation, JCAnnotation ast, JavacNode annotationNode) { handleExperimentalFlagUsage(annotationNode, ConfigurationKeys.UTLITY_CLASS_FLAG_USAGE, "@UtilityClass"); deleteAnnotationIfNeccessary(annotationNode, UtilityClass.class); JavacNode typeNode = annotationNode.up(); if (!checkLegality(typeNode, annotationNode)) return; changeModifiersAndGenerateConstructor(annotationNode.up(), annotationNode); }
Example #5
Source File: RedundantModifiersOnUtilityClassLombokAnnotationInspection.java From lombok-intellij-plugin with BSD 3-Clause "New" or "Revised" License | 5 votes |
public RedundantModifiersOnUtilityClassLombokAnnotationInspection() { super( UtilityClass.class, new RedundantModifiersInfo(CLASS, null,"@UtilityClass already marks the class final.", FINAL), new RedundantModifiersInfo(FIELD, null, "@UtilityClass already marks fields static.", STATIC), new RedundantModifiersInfo(METHOD, null, "@UtilityClass already marks methods static." , STATIC), new RedundantModifiersInfo(INNER_CLASS, null, "@UtilityClass already marks inner classes static.", STATIC) ); }
Example #6
Source File: UtilityClassProcessor.java From lombok-intellij-plugin with BSD 3-Clause "New" or "Revised" License | 4 votes |
public UtilityClassProcessor() { super(PsiMethod.class, UtilityClass.class); }