java.lang.Object
edu.hm.hafner.analysis.IssueParser
edu.hm.hafner.analysis.LookaheadParser
- Alle implementierten Schnittstellen:
Serializable
- Bekannte direkte Unterklassen:
AbstractMavenLogParser,AcuCobolParser,AnsibleLintParser,Armcc5CompilerParser,ArmccCompilerParser,BluePearlParser,BuckminsterParser,CadenceIncisiveParser,CargoClippyParser,ClangParser,ClangTidyParser,CMakeParser,CodeAnalysisParser,CodeCheckerParser,CodeGeneratorParser,CoolfluxChessccParser,CppLintParser,CrossCoreEmbeddedStudioParser,DiabCParser,DrMemoryParser,EclipseMavenParser,EclipseParser,ErlcParser,ErrorProneParser,FlawfinderParser,FlexSdkParser,FoodcriticParser,Gcc4CompilerParser,Gcc4LinkerParser,GccParser,GhsMultiParser,GnatParser,GnuFortranParser,GoLintParser,GoVetParser,GradleErrorProneParser,IarCstatParser,IarParser,IntelParser,InvalidsParser,MentorParser,MetrowerksCwCompilerParser,MetrowerksCwLinkerParser,MsBuildParser,NagFortranParser,OELintAdvParser,P4Parser,Pep8Parser,PerlCriticParser,PhpParser,PreFastParser,ProtoLintParser,PuppetLintParser,PyLintParser,QacSourceCodeAnalyserParser,RobocopyParser,RuboCopParser,SbtScalacParser,ScalacParser,SphinxBuildLinkCheckParser,SphinxBuildParser,SunCParser,TaskingVxCompilerParser,TiCcsParser,TnsdlParser,XlcCompilerParser,XlcLinkerParser,YuiCompressorParser
Parses a report file line by line for issues using a pre-defined regular expression. If the regular expression
matches then the abstract method
createIssue(Matcher, LookaheadStream, IssueBuilder) will be called. Sub
classes need to provide an implementation that transforms the Matcher instance into a new issue. If required,
sub classes may consume additional lines from the report file before control is handed back to the template method of
this parser.- Autor:
- Ullrich Hafner
- Siehe auch:
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected static final StringPattern identifying an ant task debug output prefix.Von Klasse geerbte Felder edu.hm.hafner.analysis.IssueParser
ADDITIONAL_PROPERTIES, CATEGORY, COLUMN_END, COLUMN_START, DESCRIPTION, FILE_NAME, FINGERPRINT, ID, LINE_END, LINE_RANGE_END, LINE_RANGE_START, LINE_RANGES, LINE_START, MESSAGE, MODULE_NAME, ORIGIN, PACKAGE_NAME, SEVERITY, TYPE -
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungprotectedLookaheadParser(String pattern) Creates a new instance ofLookaheadParser. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcreateIssue(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.parse(ReaderFactory readerFactory) Parses the specified file for issues.protected ReportpostProcess(Report report) Post processes the issues.protected voidpreprocessLine(String line) Preprocesses the specified line.Von Klasse geerbte Methoden edu.hm.hafner.analysis.IssueParser
accepts, equalsIgnoreCase, isXmlFile, parseFile
-
Felddetails
-
ANT_TASK
Pattern identifying an ant task debug output prefix.- Siehe auch:
-
-
Konstruktordetails
-
LookaheadParser
Creates a new instance ofLookaheadParser.- Parameter:
pattern- pattern of compiler warnings.
-
-
Methodendetails
-
parse
Beschreibung aus Klasse kopiert:IssueParserParses the specified file for issues.- Angegeben von:
parsein KlasseIssueParser- Parameter:
readerFactory- provides a reader to the reports- Gibt zurück:
- the issues
- Löst aus:
ParsingException- Signals that during parsing a non-recoverable error has been occurredParsingCanceledException- Signals that the parsing has been aborted by the user
-
preprocessLine
Preprocesses the specified line. This method is called before the line is checked for a match. Subclasses may override this empty default implementation.- Parameter:
line- the line to preprocess
-
createIssue
protected abstract Optional<Issue> createIssue(Matcher matcher, edu.hm.hafner.util.LookaheadStream lookahead, IssueBuilder builder) throws ParsingException Creates 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.- Parameter:
matcher- the regular expression matcherlookahead- the lookahead stream to read additional linesbuilder- the issue builder to use- Gibt zurück:
- a new annotation for the specified pattern
- Löst aus:
ParsingException- Signals that during parsing a non recoverable error has been occurred
-
isLineInteresting
Returns 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.- Parameter:
line- the line to inspect- Gibt zurück:
trueif the line should be handed over to the regular expression scanner,falseif the line does not contain a warning.
-
postProcess
Post processes the issues. This default implementation does nothing.- Parameter:
report- the issues after the parsing process- Gibt zurück:
- the post processed issues
-