Class LookaheadParser

    • Field Detail

      • ANT_TASK

        protected static final String ANT_TASK
        Pattern identifying an ant task debug output prefix.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LookaheadParser

        protected LookaheadParser​(String pattern)
        Creates a new instance of LookaheadParser.
        Parameters:
        pattern - pattern of compiler warnings.
    • Method Detail

      • 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 return Optional.empty() to ignore this warning.
        Parameters:
        matcher - the regular expression matcher
        lookahead - the lookahead stream to read additional lines
        builder - 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
      • isLineInteresting

        protected boolean isLineInteresting​(String line)
        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 return true.
        Parameters:
        line - the line to inspect
        Returns:
        true if the line should be handed over to the regular expression scanner, false if the line does not contain a warning.
      • postProcess

        protected Report postProcess​(Report report)
        Post processes the issues. This default implementation does nothing.
        Parameters:
        report - the issues after the parsing process
        Returns:
        the post processed issues