Class AbstractXmlEventParser
java.lang.Object
org.eluder.coveralls.maven.plugin.parser.AbstractXmlEventParser
- All Implemented Interfaces:
CoverageParser
- Direct Known Subclasses:
CloverParser, CoberturaParser, JaCoCoParser, SagaParser
The Class AbstractXmlEventParser.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractXmlEventParser(File coverageFile, SourceLoader sourceLoader) Instantiates a new abstract xml event parser. -
Method Summary
Modifier and TypeMethodDescriptionprotected XMLStreamReadercreateEventReader(InputStream inputStream) Creates the event reader.final FileGets the coverage file.protected final booleanisEndElement(XMLStreamReader xml, String name) Checks if is end element.protected final booleanisStartElement(XMLStreamReader xml, String name) Checks if is start element.protected final SourceloadSource(String sourceFile) Load source.protected abstract voidonEvent(XMLStreamReader xml, SourceCallback callback) On event.final voidparse(SourceCallback callback) Parses a coverage report.
-
Constructor Details
-
AbstractXmlEventParser
Instantiates a new abstract xml event parser.- Parameters:
coverageFile- the coverage filesourceLoader- the source loader
-
-
Method Details
-
parse
Description copied from interface:CoverageParserParses a coverage report. Parsed source files are passed to the callback handler. This method should be called only once per instance.- Specified by:
parsein interfaceCoverageParser- Parameters:
callback- the source callback handler- Throws:
ProcessingException- if processing of the coverage report failsIOException- if an I/O error occurs
-
getCoverageFile
Description copied from interface:CoverageParserGets the coverage file.- Specified by:
getCoverageFilein interfaceCoverageParser- Returns:
- the coverage report file under processing
-
createEventReader
Creates the event reader.- Parameters:
inputStream- the input stream- Returns:
- the XML stream reader
- Throws:
ProcessingException- the processing exception
-
onEvent
protected abstract void onEvent(XMLStreamReader xml, SourceCallback callback) throws XMLStreamException, ProcessingException, IOException On event.- Parameters:
xml- the xmlcallback- the callback- Throws:
XMLStreamException- the XML stream exceptionProcessingException- the processing exceptionIOException- Signals that an I/O exception has occurred.
-
loadSource
Load source.- Parameters:
sourceFile- the source file- Returns:
- the source
- Throws:
IOException- Signals that an I/O exception has occurred.
-
isStartElement
Checks if is start element.- Parameters:
xml- the xmlname- the name- Returns:
- true, if is start element
-
isEndElement
Checks if is end element.- Parameters:
xml- the xmlname- the name- Returns:
- true, if is end element
-