Package edu.hm.hafner.analysis.parser
Class AntJavacParser
- java.lang.Object
-
- edu.hm.hafner.analysis.IssueParser
-
- edu.hm.hafner.analysis.LookaheadParser
-
- edu.hm.hafner.analysis.parser.AntJavacParser
-
- All Implemented Interfaces:
Serializable
public class AntJavacParser extends LookaheadParser
A parser for the ant javac compiler warnings.- Author:
- Ullrich Hafner
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class edu.hm.hafner.analysis.LookaheadParser
ANT_TASK
-
-
Constructor Summary
Constructors Constructor Description AntJavacParser()Creates a new instance ofAntJavacParser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Optional<Issue>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
-
Methods inherited from class edu.hm.hafner.analysis.IssueParser
accepts, equalsIgnoreCase, isXmlFile, parseFile
-
-
-
-
Constructor Detail
-
AntJavacParser
public AntJavacParser()
Creates a new instance ofAntJavacParser.
-
-
Method Detail
-
isLineInteresting
protected boolean isLineInteresting(String line)
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
-
-