All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.hm.hafner.analysis.registry.NativeFormatDescriptor Maven / Gradle / Ivy

package edu.hm.hafner.analysis.registry;

import java.util.Collection;

import edu.hm.hafner.analysis.Issue;
import edu.hm.hafner.analysis.IssueParser;
import edu.hm.hafner.analysis.parser.JsonLogParser;
import edu.hm.hafner.analysis.parser.JsonParser;
import edu.hm.hafner.analysis.parser.XmlParser;

import static j2html.TagCreator.*;

/**
 * A descriptor for the native format of the analysis model. This format is a 1:1 mapping of the properties of the
 * {@link Issue} bean.
 *
 * @author Lorenz Munsch
 */
class NativeFormatDescriptor extends CompositeParserDescriptor {
    private static final String ID = "native";
    private static final String NAME = "Native Analysis Model Format";

    NativeFormatDescriptor() {
        super(ID, NAME);
    }

    @Override
    protected Collection createParsers() {
        return asList(new XmlParser("/report/issue"), new JsonLogParser(), new JsonParser());
    }

    @Override
    public String getHelp() {
        return p().withText("Create an output file that contains issues in the native analysis-model format, "
                + "in either XML or JSON. "
                + "The parser is even capable of reading individual lines of a log file that contains issues in JSON format.").render();
    }

    @Override
    public String getUrl() {
        return "https://github.com/jenkinsci/warnings-ng-plugin/blob/master/doc/Documentation.md#export-your-issues-into-a-supported-format";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy