2 * Copyright 2000-2016 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.codeInspection.reference.RefEntity;
19 import org.jetbrains.annotations.NotNull;
20 import org.jetbrains.annotations.Nullable;
23 * Collects the results of a global inspection.
27 * @see GlobalInspectionTool#runInspection
29 public interface ProblemDescriptionsProcessor {
31 * Returns the problems which have been collected for the specified reference graph node.
33 * @param refEntity the reference graph node.
34 * @return the problems found for the specified node.
37 default CommonProblemDescriptor[] getDescriptions(@NotNull RefEntity refEntity) {
38 return CommonProblemDescriptor.EMPTY_ARRAY;
42 * Drops all problems which have been collected for the specified reference graph node.
44 * @param refEntity the reference graph node.
46 default void ignoreElement(@NotNull RefEntity refEntity) {
50 * Registers a problem or several problems, with optional quickfixes, for the specified
51 * reference graph node.
53 * @param refEntity the reference graph node.
54 * @param commonProblemDescriptors the descriptors for the problems to register.
56 default void addProblemElement(@Nullable RefEntity refEntity, @NotNull CommonProblemDescriptor... commonProblemDescriptors) {
59 default RefEntity getElement(@NotNull CommonProblemDescriptor descriptor) {