java.lang.Object
edu.hm.hafner.analysis.IssueParser
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AbstractDryParser,AbstractViolationAdapter,AjcParser,CargoCheckParser,CcmParser,CheckStyleParser,ClangAnalyzerPlistParser,EclipseXMLParser,EmbeddedEngineerParser,FindBugsParser,FxCopParser,GendarmeParser,IdeaInspectionParser,JcReportParser,JsonIssueParser,JsonLogParser,JsonParser,LintParser,LookaheadParser,PmdParser,PolyspaceParser,PVSStudioParser,QtTranslationParser,RfLintParser,SimulinkCheckParser,StyleCopParser,TaglistParser,XmlParser
Parses a file and returns the issues reported in this file.
- Author:
- Ullrich Hafner
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(ReaderFactory readerFactory) Returns whether this parser accepts the specified file as valid input.static booleanequalsIgnoreCase(String a, String b) Compares two CharSequences, returningtrueif they represent equal sequences of characters, ignoring case.protected booleanisXmlFile(ReaderFactory readerFactory) Returns whether the specified file is an XML file.abstract Reportparse(ReaderFactory readerFactory) Parses the specified file for issues.parseFile(ReaderFactory readerFactory) Parses the specified file for issues.
-
Field Details
-
ADDITIONAL_PROPERTIES
- See Also:
-
CATEGORY
- See Also:
-
COLUMN_END
- See Also:
-
COLUMN_START
- See Also:
-
DESCRIPTION
- See Also:
-
FILE_NAME
- See Also:
-
FINGERPRINT
- See Also:
-
ID
- See Also:
-
LINE_END
- See Also:
-
LINE_RANGES
- See Also:
-
LINE_RANGE_END
- See Also:
-
LINE_RANGE_START
- See Also:
-
LINE_START
- See Also:
-
MESSAGE
- See Also:
-
MODULE_NAME
- See Also:
-
ORIGIN
- See Also:
-
PACKAGE_NAME
- See Also:
-
SEVERITY
- See Also:
-
TYPE
- See Also:
-
-
Constructor Details
-
IssueParser
public IssueParser()
-
-
Method Details
-
parse
public abstract Report parse(ReaderFactory readerFactory) throws ParsingException, ParsingCanceledException Parses the specified file for issues.- Parameters:
readerFactory- provides a reader to the reports- Returns:
- the issues
- Throws:
ParsingException- Signals that during parsing a non-recoverable error has been occurredParsingCanceledException- Signals that the parsing has been aborted by the user
-
parseFile
public Report parseFile(ReaderFactory readerFactory) throws ParsingException, ParsingCanceledException Parses the specified file for issues. Invokes the parser usingparse(ReaderFactory)and sets the file name of the report.- Parameters:
readerFactory- provides a reader to the reports- Returns:
- the issues
- Throws:
ParsingException- Signals that during parsing a non-recoverable error has been occurredParsingCanceledException- Signals that the parsing has been aborted by the user
-
accepts
Returns 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.- 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
-
isXmlFile
Returns whether the specified file is an XML file. This method just checks if the first 10 lines contain the XML tag rather than parsing the whole document.- Parameters:
readerFactory- the file to check- Returns:
trueif the file is an XML file,falseotherwise
-
equalsIgnoreCase
Compares two CharSequences, returning
trueif they represent equal sequences of characters, ignoring case.nulls are handled without exceptions. Twonullreferences are considered equal. The comparison is case insensitive.equalsIgnoreCase(null, null) = true equalsIgnoreCase(null, "abc") = false equalsIgnoreCase("abc", null) = false equalsIgnoreCase("abc", "abc") = true equalsIgnoreCase("abc", "ABC") = true- Parameters:
a- the first CharSequence, may benullb- the second CharSequence, may benull- Returns:
trueif the CharSequences are equal (case-insensitive), or bothnull
-