2 * Copyright 2000-2007 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com
.intellij
.codeInspection
;
18 import com
.intellij
.openapi
.project
.Project
;
19 import com
.intellij
.openapi
.util
.TextRange
;
20 import com
.intellij
.psi
.PsiElement
;
21 import org
.jetbrains
.annotations
.NotNull
;
22 import org
.jetbrains
.annotations
.Nullable
;
27 public abstract class InspectionManager
{
28 public static InspectionManager
getInstance(Project project
) {
29 return project
.getComponent(InspectionManager
.class);
32 @NotNull public abstract CommonProblemDescriptor
createProblemDescriptor(@NotNull String descriptionTemplate
, QuickFix
... fixes
);
35 * Factory method for ProblemDescriptor. Should be called from LocalInspectionTool.checkXXX() methods.
36 * @param psiElement problem is reported against
37 * @param descriptionTemplate problem message. Use <code>#ref</code> for a link to problem piece of code and <code>#loc</code> for location in source code.
38 * @param fix should be null if no fix is provided.
40 @NotNull public abstract ProblemDescriptor
createProblemDescriptor(@NotNull PsiElement psiElement
, @NotNull String descriptionTemplate
, LocalQuickFix fix
, ProblemHighlightType highlightType
);
42 @NotNull public abstract ProblemDescriptor
createProblemDescriptor(@NotNull PsiElement psiElement
, @NotNull String descriptionTemplate
, LocalQuickFix
[] fixes
, ProblemHighlightType highlightType
);
44 @NotNull public abstract ProblemDescriptor
createProblemDescriptor(@NotNull PsiElement psiElement
, @NotNull String descriptionTemplate
, LocalQuickFix
[] fixes
, ProblemHighlightType highlightType
, boolean isAfterEndOfLine
);
46 @NotNull public abstract ProblemDescriptor
createProblemDescriptor(@NotNull PsiElement startElement
,
47 @NotNull PsiElement endElement
,
48 @NotNull String descriptionTemplate
,
49 ProblemHighlightType highlightType
,
50 LocalQuickFix
... fixes
54 @NotNull public abstract Project
getProject();
56 public abstract ProblemDescriptor
createProblemDescriptor(@NotNull final PsiElement psiElement
,
57 final TextRange rangeInElement
,
58 @NotNull final String descriptionTemplate
,
59 final ProblemHighlightType highlightType
,
60 final LocalQuickFix
... fixes
);
62 public abstract ProblemDescriptor
createProblemDescriptor(@NotNull final PsiElement psiElement
,
63 @NotNull final String descriptionTemplate
,
64 final ProblemHighlightType highlightType
,
65 @Nullable final HintAction hintAction
,
66 final LocalQuickFix
... fixes
);