Search in sources :

Example 1 with BindingGraph

use of dagger.model.BindingGraph 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;
}
Also used : BindingGraph(dagger.model.BindingGraph) DiagnosticReporter(dagger.spi.DiagnosticReporter) BindingGraphPlugin(dagger.spi.model.BindingGraphPlugin)

Aggregations

BindingGraph (dagger.model.BindingGraph)1 DiagnosticReporter (dagger.spi.DiagnosticReporter)1 BindingGraphPlugin (dagger.spi.model.BindingGraphPlugin)1