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 ofNode
instances.- Author:
- Ullrich Hafner
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CoverageParser()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static edu.hm.hafner.util.SecureXmlParserFactory.ParsingException
createEofException()
protected static int
getIntegerValueOf(StartElement element, QName attributeName)
protected static Optional<String>
getOptionalValueOf(StartElement element, QName attribute)
edu.hm.hafner.util.TreeStringBuilder
getTreeStringBuilder()
protected static String
getValueOf(StartElement element, QName attribute)
ModuleNode
parse(Reader reader, edu.hm.hafner.util.FilteredLog log)
Parses a report provided by the given reader.protected static int
parseInteger(String value)
protected abstract ModuleNode
parseReport(Reader reader, edu.hm.hafner.util.FilteredLog log)
Parses a report provided by the given reader.protected Object
readResolve()
Called after de-serialization to restore transient fields.
-
-
-
Method Detail
-
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 informationlog
- 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 informationlog
- 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()
-
-