本文整理汇总了Java中com.intellij.codeInspection.SuppressManager类的典型用法代码示例。如果您正苦于以下问题:Java SuppressManager类的具体用法?Java SuppressManager怎么用?Java SuppressManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SuppressManager类属于com.intellij.codeInspection包,在下文中一共展示了SuppressManager类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTokenizer
import com.intellij.codeInspection.SuppressManager; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
if (element instanceof PsiMethod) {
return myMethodNameTokenizer;
}
if (element instanceof PsiDocComment) {
return myDocCommentTokenizer;
}
if (element instanceof PsiLiteralExpression) {
if (SuppressManager.isSuppressedInspectionName((PsiLiteralExpression)element)) {
return EMPTY_TOKENIZER;
}
return myLiteralExpressionTokenizer;
}
if (element instanceof PsiNamedElement) {
return myNamedElementTokenizer;
}
return super.getTokenizer(element);
}
示例2: shouldCheck
import com.intellij.codeInspection.SuppressManager; //导入依赖的package包/类
private boolean shouldCheck(@NotNull Project project, @NotNull PsiLiteralExpression expression)
{
if(IGNORE_PROPERTY_KEYS && JavaI18nUtil.mustBePropertyKey(project, expression, new THashMap<String, Object>()))
{
return false;
}
return !SuppressManager.isSuppressedInspectionName(expression);
}
示例3: visitAnnotation
import com.intellij.codeInspection.SuppressManager; //导入依赖的package包/类
@Override
public void visitAnnotation(PsiAnnotation annotation) {
super.visitAnnotation(annotation);
final PsiJavaCodeReferenceElement reference =
annotation.getNameReferenceElement();
if (reference == null) {
return;
}
@NonNls final String text = reference.getText();
if ("SuppressWarnings".equals(text) ||
SuppressManager.SUPPRESS_INSPECTIONS_ANNOTATION_NAME.equals(text)) {
registerError(annotation);
}
}
示例4: isToCheckMember
import com.intellij.codeInspection.SuppressManager; //导入依赖的package包/类
@Override
public boolean isToCheckMember(@NotNull final PsiElement element, @NotNull final String id) {
return SuppressManager.getInstance().getElementToolSuppressedIn(element, id) == null;
}
示例5: getSuppressedInspectionIdsIn
import com.intellij.codeInspection.SuppressManager; //导入依赖的package包/类
@Override
@Nullable
public String getSuppressedInspectionIdsIn(@NotNull final PsiElement element) {
return SuppressManager.getInstance().getSuppressedInspectionIdsIn(element);
}
示例6: isToCheckMember
import com.intellij.codeInspection.SuppressManager; //导入依赖的package包/类
@Override
public boolean isToCheckMember(final PsiElement element, final String id) {
return SuppressManager.getInstance().getElementToolSuppressedIn(element, id) == null;
}
示例7: getSuppressedInspectionIdsIn
import com.intellij.codeInspection.SuppressManager; //导入依赖的package包/类
@Override
@Nullable
public String getSuppressedInspectionIdsIn(final PsiElement element) {
return SuppressManager.getInstance().getSuppressedInspectionIdsIn(element);
}
示例8: isSuppressedFor
import com.intellij.codeInspection.SuppressManager; //导入依赖的package包/类
@Override
public boolean isSuppressedFor(@NotNull PsiElement element, @NotNull String name) {
return SuppressManager.getInstance().isSuppressedFor(element, name);
}