當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。