Search in sources :

Example 1 with XmlAnalyzer

use of org.sonar.java.xml.XmlAnalyzer in project sonar-java by SonarSource.

the class XmlFileSensor method execute.

@Override
public void execute(SensorContext context) {
    if (hasXmlFiles()) {
        Iterable<InputFile> xmlInputFiles = getXmlFiles();
        // make xml files visible in SQ UI, when XML plugin is not installed
        xmlInputFiles.forEach(context::markForPublishing);
        sonarComponents.registerCheckClasses(CheckList.REPOSITORY_KEY, CheckList.getXmlChecks());
        sonarComponents.setSensorContext(context);
        new XmlAnalyzer(sonarComponents, sonarComponents.checkClasses()).scan(toFile(xmlInputFiles));
    }
}
Also used : XmlAnalyzer(org.sonar.java.xml.XmlAnalyzer) InputFile(org.sonar.api.batch.fs.InputFile)

Aggregations

InputFile (org.sonar.api.batch.fs.InputFile)1 XmlAnalyzer (org.sonar.java.xml.XmlAnalyzer)1