本文整理汇总了Java中lombok.experimental.UtilityClass类的典型用法代码示例。如果您正苦于以下问题:Java UtilityClass类的具体用法?Java UtilityClass怎么用?Java UtilityClass使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UtilityClass类属于lombok.experimental包,在下文中一共展示了UtilityClass类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isSupported
import lombok.experimental.UtilityClass; //导入依赖的package包/类
@Override
public boolean isSupported(@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 (!isElementFieldMethodOrInnerClass(modifierListParent)) {
return false;
}
PsiClass searchableClass = PsiTreeUtil.getParentOfType(modifierListParent, PsiClass.class, true);
return null != searchableClass && PsiAnnotationSearchUtil.isAnnotatedWith(searchableClass, UtilityClass.class) && UtilityClassProcessor.validateOnRightType(searchableClass, new ProblemNewBuilder());
}
示例2: transformModifiers
import lombok.experimental.UtilityClass; //导入依赖的package包/类
@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 (isElementFieldMethodOrInnerClass(parent)) {
modifiers.add(PsiModifier.STATIC);
}
}
示例3: handle
import lombok.experimental.UtilityClass; //导入依赖的package包/类
@Override public void handle(AnnotationValues<UtilityClass> annotation, Annotation ast, EclipseNode annotationNode) {
handleFlagUsage(annotationNode, ConfigurationKeys.UTILITY_CLASS_FLAG_USAGE, "@UtilityClass");
EclipseNode typeNode = annotationNode.up();
if (!checkLegality(typeNode, annotationNode)) return;
changeModifiersAndGenerateConstructor(annotationNode.up(), annotationNode);
}
示例4: handle
import lombok.experimental.UtilityClass; //导入依赖的package包/类
@Override public void handle(AnnotationValues<UtilityClass> annotation, JCAnnotation ast, JavacNode annotationNode) {
handleExperimentalFlagUsage(annotationNode, ConfigurationKeys.UTILITY_CLASS_FLAG_USAGE, "@UtilityClass");
deleteAnnotationIfNeccessary(annotationNode, UtilityClass.class);
JavacNode typeNode = annotationNode.up();
if (!checkLegality(typeNode, annotationNode)) return;
changeModifiersAndGenerateConstructor(annotationNode.up(), annotationNode);
}
示例5: handle
import lombok.experimental.UtilityClass; //导入依赖的package包/类
@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);
}
示例6: handle
import lombok.experimental.UtilityClass; //导入依赖的package包/类
@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);
}
示例7: UtilityClassProcessor
import lombok.experimental.UtilityClass; //导入依赖的package包/类
public UtilityClassProcessor() {
super(PsiMethod.class, UtilityClass.class);
}