Package edu.hm.hafner.analysis.parser
Class MavenConsoleParser
- java.lang.Object
-
- edu.hm.hafner.analysis.IssueParser
-
- edu.hm.hafner.analysis.LookaheadParser
-
- edu.hm.hafner.analysis.parser.MavenConsoleParser
-
- All Implemented Interfaces:
Serializable
public class MavenConsoleParser extends LookaheadParser
A parser for maven console warnings.- Author:
- Ullrich Hafner
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static PatternMAVEN_PLUGIN_STARTRegular expression to parse the start of maven plugin in console.-
Fields inherited from class edu.hm.hafner.analysis.LookaheadParser
ANT_TASK
-
-
Constructor Summary
Constructors Constructor Description MavenConsoleParser()Creates a new instance ofMavenConsoleParser.
-
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
-
-
-
-
Field Detail
-
MAVEN_PLUGIN_START
protected static final Pattern MAVEN_PLUGIN_START
Regular expression to parse the start of maven plugin in console.
-
-
Constructor Detail
-
MavenConsoleParser
public MavenConsoleParser()
Creates a new instance ofMavenConsoleParser.
-
-
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) throws ParsingException
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
- Throws:
ParsingException- Signals that during parsing a non recoverable error has been occurred
-
-