Class CoverageParser

java.lang.Object
com.parasoft.findings.jenkins.coverage.model.CoverageParser
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CoberturaParser, JacocoParser

public abstract class CoverageParser extends Object implements Serializable
Parses a file and returns the code coverage information in a tree of Node instances.
Author:
Ullrich Hafner
See Also:
  • Constructor Details

    • CoverageParser

      public CoverageParser()
  • Method Details

    • parse

      public ModuleNode parse(Reader reader, edu.hm.hafner.util.FilteredLog log)
      Parses a report provided by the given reader.
      Parameters:
      reader - the reader with the coverage information
      log - the logger to write messages to
      Returns:
      the root of the created tree
      Throws:
      edu.hm.hafner.util.SecureXmlParserFactory.ParsingException - if the XML content cannot be read
    • readResolve

      protected Object readResolve()
      Called after de-serialization to restore transient fields.
      Returns:
      this
    • getTreeStringBuilder

      public final edu.hm.hafner.util.TreeStringBuilder getTreeStringBuilder()
    • parseReport

      protected abstract ModuleNode parseReport(Reader reader, edu.hm.hafner.util.FilteredLog log)
      Parses a report provided by the given reader.
      Parameters:
      reader - the reader with the coverage information
      log - the logger to write messages to
      Returns:
      the root of the created tree
      Throws:
      edu.hm.hafner.util.SecureXmlParserFactory.ParsingException - if the XML content cannot be read
    • getOptionalValueOf

      protected static Optional<String> getOptionalValueOf(StartElement element, QName attribute)
    • getIntegerValueOf

      protected static int getIntegerValueOf(StartElement element, QName attributeName)
    • getValueOf

      protected static String getValueOf(StartElement element, QName attribute)
    • parseInteger

      protected static int parseInteger(String value)
    • createEofException

      protected static edu.hm.hafner.util.SecureXmlParserFactory.ParsingException createEofException()