forked from google/dagger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDiagnosticReporter.java
More file actions
103 lines (93 loc) · 3.36 KB
/
Copy pathDiagnosticReporter.java
File metadata and controls
103 lines (93 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
* Copyright (C) 2018 The Dagger Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dagger.spi;
import com.google.errorprone.annotations.FormatMethod;
import dagger.model.BindingGraph;
import dagger.model.BindingGraph.ChildFactoryMethodEdge;
import dagger.model.BindingGraph.ComponentNode;
import dagger.model.BindingGraph.DependencyEdge;
import dagger.model.BindingGraph.MaybeBinding;
import javax.tools.Diagnostic;
/**
* An object that {@link BindingGraphPlugin}s can use to report diagnostics while visiting a {@link
* BindingGraph}.
*
* <p>Note: This API is still experimental and will change.
*/
public interface DiagnosticReporter {
/**
* Reports a diagnostic for a component. For non-root components, includes information about the
* path from the root component.
*/
void reportComponent(Diagnostic.Kind diagnosticKind, ComponentNode componentNode, String message);
/**
* Reports a diagnostic for a component. For non-root components, includes information about the
* path from the root component.
*/
@FormatMethod
void reportComponent(
Diagnostic.Kind diagnosticKind,
ComponentNode componentNode,
String messageFormat,
Object firstArg,
Object... moreArgs);
/**
* Reports a diagnostic for a binding or missing binding. Includes information about how the
* binding is reachable from entry points.
*/
void reportBinding(Diagnostic.Kind diagnosticKind, MaybeBinding binding, String message);
/**
* Reports a diagnostic for a binding or missing binding. Includes information about how the
* binding is reachable from entry points.
*/
@FormatMethod
void reportBinding(
Diagnostic.Kind diagnosticKind,
MaybeBinding binding,
String messageFormat,
Object firstArg,
Object... moreArgs);
/**
* Reports a diagnostic for a dependency. Includes information about how the dependency is
* reachable from entry points.
*/
void reportDependency(
Diagnostic.Kind diagnosticKind, DependencyEdge dependencyEdge, String message);
/**
* Reports a diagnostic for a dependency. Includes information about how the dependency is
* reachable from entry points.
*/
@FormatMethod
void reportDependency(
Diagnostic.Kind diagnosticKind,
DependencyEdge dependencyEdge,
String messageFormat,
Object firstArg,
Object... moreArgs);
/** Reports a diagnostic for a subcomponent factory method. */
void reportSubcomponentFactoryMethod(
Diagnostic.Kind diagnosticKind,
ChildFactoryMethodEdge childFactoryMethodEdge,
String message);
/** Reports a diagnostic for a subcomponent factory method. */
@FormatMethod
void reportSubcomponentFactoryMethod(
Diagnostic.Kind diagnosticKind,
ChildFactoryMethodEdge childFactoryMethodEdge,
String messageFormat,
Object firstArg,
Object... moreArgs);
}