本文整理汇总了Java中com.siyeh.ig.DelegatingFix类的典型用法代码示例。如果您正苦于以下问题:Java DelegatingFix类的具体用法?Java DelegatingFix怎么用?Java DelegatingFix使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DelegatingFix类属于com.siyeh.ig包,在下文中一共展示了DelegatingFix类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildFixes
import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@NotNull
@Override
protected InspectionGadgetsFix[] buildFixes(Object... infos) {
final boolean suppressionIdPresent = ((Boolean)infos[1]).booleanValue();
if (infos[0] instanceof PsiAnnotation) {
final PsiAnnotation annotation = (PsiAnnotation)infos[0];
return suppressionIdPresent
? new InspectionGadgetsFix[]{new DelegatingFix(new RemoveAnnotationQuickFix(annotation, null)), new AllowSuppressionsFix()}
: new InspectionGadgetsFix[]{new DelegatingFix(new RemoveAnnotationQuickFix(annotation, null))};
} else if (infos[0] instanceof PsiComment) {
return suppressionIdPresent
? new InspectionGadgetsFix[]{new RemoveSuppressCommentFix(), new AllowSuppressionsFix()}
: new InspectionGadgetsFix[]{new RemoveSuppressCommentFix()};
}
return InspectionGadgetsFix.EMPTY_ARRAY;
}
示例2: buildFix
import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
@Nullable
protected InspectionGadgetsFix buildFix(Object... infos) {
final PsiElement elt = (PsiElement)infos[0];
if (!AnnotationUtil.isAnnotatingApplicable(elt)) {
return null;
}
if (PsiTreeUtil.getParentOfType(elt, PsiMethod.class, PsiLambdaExpression.class) instanceof PsiLambdaExpression) {
return null;
}
final NullableNotNullManager manager = NullableNotNullManager.getInstance(elt.getProject());
return new DelegatingFix(new AnnotateMethodFix(
manager.getDefaultNullable(),
ArrayUtil.toStringArray(manager.getNotNulls())){
@Override
public int shouldAnnotateBaseMethod(PsiMethod method, PsiMethod superMethod, Project project) {
return ReturnNullInspectionBase.this.shouldAnnotateBaseMethod(method, superMethod);
}
});
}
示例3: buildFix
import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
@Nullable
protected InspectionGadgetsFix buildFix(Object... infos) {
final PsiElement elt = (PsiElement)infos[0];
if (!AnnotationUtil.isAnnotatingApplicable(elt)) {
return null;
}
final NullableNotNullManager manager =
NullableNotNullManager.getInstance(elt.getProject());
return new DelegatingFix(new AnnotateMethodFix(
manager.getDefaultNullable(),
ArrayUtil.toStringArray(manager.getNotNulls())){
@Override
public int shouldAnnotateBaseMethod(PsiMethod method, PsiMethod superMethod, Project project) {
return ReturnNullInspectionBase.this.shouldAnnotateBaseMethod(method, superMethod);
}
});
}
示例4: buildFix
import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
protected InspectionGadgetsFix buildFix(Object... infos) {
final PsiMethod constructor = (PsiMethod)infos[1];
if (constructor == null) {
final PsiClass aClass = (PsiClass)infos[0];
if (aClass instanceof PsiAnonymousClass) {
// can't create constructor for anonymous class
return null;
}
return new DelegatingFix(new AddDefaultConstructorFix(aClass, PsiModifier.PUBLIC));
}
else {
return new MakeConstructorPublicFix();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ExternalizableWithoutPublicNoArgConstructorInspection.java
示例5: buildFix
import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
protected InspectionGadgetsFix buildFix(Object... infos) {
final Object info = infos[0];
if (!(info instanceof PsiReferenceExpression)) {
return null;
}
final PsiElement target = ((PsiReferenceExpression)info).resolve();
if (!(target instanceof PsiVariable)) {
return null;
}
final NullableNotNullManager manager = NullableNotNullManager.getInstance(target.getProject());
return new DelegatingFix(new AddAnnotationPsiFix(manager.getDefaultNullable(), (PsiVariable)target,PsiNameValuePair.EMPTY_ARRAY));
}
示例6: buildFix
import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Nullable
@Override
protected InspectionGadgetsFix buildFix(Object... infos) {
return new DelegatingFix(new AnnotateMethodFix("org.junit.Test"){
@Override
public int shouldAnnotateBaseMethod(PsiMethod method, PsiMethod superMethod, Project project) {
return 1;
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:JUnit3StyleTestMethodInJUnit4ClassInspection.java
示例7: build
import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
public static List<InspectionGadgetsFix> build(final PsiModifierListOwner modifierListOwner,
final List<String> configurationList,
final List<InspectionGadgetsFix> fixes) {
SpecialAnnotationsUtilBase.createAddToSpecialAnnotationFixes(modifierListOwner, new Processor<String>() {
@Override
public boolean process(String qualifiedName) {
fixes.add(new DelegatingFix(SpecialAnnotationsUtilBase.createAddToSpecialAnnotationsListQuickFix(
InspectionGadgetsBundle.message("add.0.to.ignore.if.annotated.by.list.quickfix", qualifiedName),
QuickFixBundle.message("fix.add.special.annotation.family"),
configurationList, qualifiedName, modifierListOwner)));
return true;
}
});
return fixes;
}
示例8: buildFix
import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
@Nullable
protected InspectionGadgetsFix buildFix(Object... infos) {
final PsiReferenceExpression methodExpression =
(PsiReferenceExpression)infos[0];
final PsiModifierListOwner annotatableQualifier =
NonNlsUtils.getAnnotatableQualifier(
methodExpression);
if (annotatableQualifier == null) {
return null;
}
return new DelegatingFix(new AddAnnotationPsiFix(
AnnotationUtil.NON_NLS, annotatableQualifier,PsiNameValuePair.EMPTY_ARRAY));
}
示例9: buildFix
import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
protected InspectionGadgetsFix buildFix(Object... infos) {
final Object info = infos[0];
if (!(info instanceof PsiReferenceExpression)) {
return null;
}
final PsiElement target = ((PsiReferenceExpression)info).resolve();
if (!(target instanceof PsiVariable)) {
return null;
}
final NullableNotNullManager manager = NullableNotNullManager.getInstance(target.getProject());
return new DelegatingFix(new AddAnnotationFix(manager.getDefaultNullable(), (PsiVariable)target));
}
示例10: build
import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
public static List<InspectionGadgetsFix> build(final PsiModifierListOwner modifierListOwner, final List<String> configurationList, final List<InspectionGadgetsFix> fixes)
{
SpecialAnnotationsUtilBase.createAddToSpecialAnnotationFixes(modifierListOwner, new Processor<String>()
{
@Override
public boolean process(String qualifiedName)
{
fixes.add(new DelegatingFix(SpecialAnnotationsUtilBase.createAddToSpecialAnnotationsListQuickFix(InspectionGadgetsBundle.message("add.0.to.ignore.if.annotated.by.list.quickfix",
qualifiedName), JavaQuickFixBundle.message("fix.add.special.annotation.family"), configurationList, qualifiedName, modifierListOwner)));
return true;
}
});
return fixes;
}
示例11: buildFix
import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
@Nullable
protected InspectionGadgetsFix buildFix(Object... infos) {
final PsiElement elt = (PsiElement)infos[0];
if (!AnnotationUtil.isAnnotatingApplicable(elt)) {
return null;
}
final NullableNotNullManager manager =
NullableNotNullManager.getInstance(elt.getProject());
return new DelegatingFix(new AnnotateMethodFix(
manager.getDefaultNullable(),
ArrayUtil.toStringArray(manager.getNotNulls())));
}
示例12: buildFix
import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Override
@Nullable
protected InspectionGadgetsFix buildFix(Object... infos) {
final PsiReferenceExpression methodExpression =
(PsiReferenceExpression)infos[0];
final PsiModifierListOwner annotatableQualifier =
NonNlsUtils.getAnnotatableQualifier(
methodExpression);
if (annotatableQualifier == null) {
return null;
}
return new DelegatingFix(new AddAnnotationFix(
AnnotationUtil.NON_NLS, annotatableQualifier));
}
示例13: buildFix
import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
@Nullable
@Override
protected InspectionGadgetsFix buildFix(Object... infos) {
final PsiClass aClass = (PsiClass)infos[0];
return new DelegatingFix(new AddAnnotationPsiFix(CommonClassNames.JAVA_LANG_FUNCTIONAL_INTERFACE, aClass, PsiNameValuePair.EMPTY_ARRAY));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:InterfaceMayBeAnnotatedFunctionalInspection.java
示例14: createMakeSerializableFix
import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
public static InspectionGadgetsFix createMakeSerializableFix(PsiClass aClass) {
final PsiClassType type = TypeUtils.getType(CommonClassNames.JAVA_IO_SERIALIZABLE, aClass);
return new DelegatingFix(QuickFixFactory.getInstance().createExtendsListFix(aClass, type, true));
}
示例15: createMakeCloneableFix
import com.siyeh.ig.DelegatingFix; //导入依赖的package包/类
public static InspectionGadgetsFix createMakeCloneableFix(PsiClass aClass) {
final PsiClassType type = TypeUtils.getType(CommonClassNames.JAVA_LANG_CLONEABLE, aClass);
return new DelegatingFix(QuickFixFactory.getInstance().createExtendsListFix(aClass, type, true));
}