use of dagger.spi.model.BindingGraphPlugin in project DaggerCodeParse-2.38.1base by hellogaod.
the class ValidationBindingGraphPlugins method visit.
/**
* Returns {@code false} if any of the plugins reported an error.
*/
boolean visit(BindingGraph graph) {
boolean errorsAsWarnings = graph.isFullBindingGraph() && compilerOptions.fullBindingGraphValidationType().equals(ValidationType.WARNING);
boolean isClean = true;
for (BindingGraphPlugin plugin : plugins) {
DiagnosticReporterFactory.DiagnosticReporterImpl reporter = diagnosticReporterFactory.reporter(graph, plugin.pluginName(), errorsAsWarnings);
plugin.visitGraph(graph, reporter);
if (reporter.reportedDiagnosticKinds().contains(ERROR)) {
isClean = false;
}
}
return isClean;
}
use of dagger.spi.model.BindingGraphPlugin in project dapper by jbock-java.
the class ValidationBindingGraphPlugins method visit.
/**
* Returns {@code false} if any of the plugins reported an error.
*/
boolean visit(BindingGraph graph) {
boolean errorsAsWarnings = graph.isFullBindingGraph() && compilerOptions.fullBindingGraphValidationType().equals(ValidationType.WARNING);
boolean isClean = true;
for (BindingGraphPlugin plugin : plugins) {
DiagnosticReporterImpl reporter = diagnosticReporterFactory.reporter(graph, plugin.pluginName(), errorsAsWarnings);
plugin.visitGraph(graph, reporter);
if (reporter.reportedDiagnosticKinds().contains(ERROR)) {
isClean = false;
}
}
return isClean;
}
use of dagger.spi.model.BindingGraphPlugin in project DaggerCodeParse-2.38.1base by hellogaod.
the class ExternalBindingGraphPlugins method visit.
/**
* Returns {@code false} if any of the plugins reported an error.
*/
boolean visit(dagger.spi.model.BindingGraph spiGraph) {
BindingGraph graph = ExternalBindingGraphConverter.fromSpiModel(spiGraph);
boolean isClean = true;
for (BindingGraphPlugin plugin : plugins) {
DiagnosticReporterFactory.DiagnosticReporterImpl spiReporter = diagnosticReporterFactory.reporter(spiGraph, plugin.pluginName(), /* reportErrorsAsWarnings= */
false);
DiagnosticReporter reporter = ExternalBindingGraphConverter.fromSpiModel(spiReporter);
plugin.visitGraph(graph, reporter);
if (spiReporter.reportedDiagnosticKinds().contains(ERROR)) {
isClean = false;
}
}
return isClean;
}
use of dagger.spi.model.BindingGraphPlugin in project dapper by jbock-java.
the class ExternalBindingGraphPlugins method visit.
/**
* Returns {@code false} if any of the plugins reported an error.
*/
boolean visit(BindingGraph graph) {
// Return early to avoid converting the binding graph when there are no externl plugins.
if (plugins.isEmpty()) {
return true;
}
boolean isClean = true;
for (BindingGraphPlugin plugin : plugins) {
DiagnosticReporterImpl reporter = diagnosticReporterFactory.reporter(graph, plugin.pluginName(), /* reportErrorsAsWarnings= */
false);
plugin.visitGraph(graph, reporter);
if (reporter.reportedDiagnosticKinds().contains(ERROR)) {
isClean = false;
}
}
return isClean;
}
Aggregations