当前位置: 首页>>代码示例>>Java>>正文


Java UtilityClass类代码示例

本文整理汇总了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());
}
 
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:21,代码来源:UtilityClassModifierProcessor.java

示例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);
  }
}
 
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:19,代码来源:UtilityClassModifierProcessor.java

示例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);
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:8,代码来源:HandleUtilityClass.java

示例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);
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:10,代码来源:HandleUtilityClass.java

示例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);
}
 
开发者ID:mobmead,项目名称:EasyMPermission,代码行数:8,代码来源:HandleUtilityClass.java

示例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);
}
 
开发者ID:mobmead,项目名称:EasyMPermission,代码行数:10,代码来源:HandleUtilityClass.java

示例7: UtilityClassProcessor

import lombok.experimental.UtilityClass; //导入依赖的package包/类
public UtilityClassProcessor() {
  super(PsiMethod.class, UtilityClass.class);
}
 
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:4,代码来源:UtilityClassProcessor.java


注:本文中的lombok.experimental.UtilityClass类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。