本文整理匯總了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);
}