Package edu.hm.hafner.analysis.parser
Class EclipseParser
java.lang.Object
edu.hm.hafner.analysis.IssueParser
edu.hm.hafner.analysis.LookaheadParser
edu.hm.hafner.analysis.parser.EclipseParser
- All Implemented Interfaces:
Serializable
A parser for Eclipse compiler warnings.
- Author:
- Ullrich Hafner, Jason Faust
- See Also:
-
Field Summary
Fields inherited from class edu.hm.hafner.analysis.LookaheadParser
ANT_TASK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(ReaderFactory readerFactory) Returns whether this parser accepts the specified file as valid input.createIssue(Matcher matcher, edu.hm.hafner.util.LookaheadStream lookahead, IssueBuilder builder) Creates a new issue for the specified pattern.protected booleanisLineInteresting(String line) Returns whether the specified line is interesting.Methods inherited from class edu.hm.hafner.analysis.LookaheadParser
parse, postProcess, preprocessLineMethods inherited from class edu.hm.hafner.analysis.IssueParser
equalsIgnoreCase, isXmlFile, parseFile
-
Constructor Details
-
EclipseParser
public EclipseParser()Creates a new instance ofEclipseParser.
-
-
Method Details
-
accepts
Description copied from class:IssueParserReturns whether this parser accepts the specified file as valid input. Parsers may reject a file if it is in the wrong format to avoid exceptions during parsing.- Overrides:
acceptsin classIssueParser- Parameters:
readerFactory- provides a reader to the reports- Returns:
trueif this parser accepts this file as valid input, orfalseif the file could not be parsed by this parser
-
isLineInteresting
Description copied from class:LookaheadParserReturns whether the specified line is interesting. Each interesting line will be matched by the defined regular expression. Here a parser can implement some fast checks (i.e. string or character comparisons) in order to see if a required condition is met. This default implementation does always returntrue.- Overrides:
isLineInterestingin classLookaheadParser- Parameters:
line- the line to inspect- Returns:
trueif the line should be handed over to the regular expression scanner,falseif the line does not contain a warning.
-
createIssue
protected Optional<Issue> createIssue(Matcher matcher, edu.hm.hafner.util.LookaheadStream lookahead, IssueBuilder builder) Description copied from class:LookaheadParserCreates a new issue for the specified pattern. This method is called for each matching line in the specified file. If a match is a false positive, then returnOptional.empty()to ignore this warning.- Specified by:
createIssuein classLookaheadParser- Parameters:
matcher- the regular expression matcherlookahead- the lookahead stream to read additional linesbuilder- the issue builder to use- Returns:
- a new annotation for the specified pattern
-