hudson.plugins.warnings.parser
Class RegexpLineParser

java.lang.Object
  extended by hudson.plugins.warnings.parser.RegexpParser
      extended by hudson.plugins.warnings.parser.RegexpLineParser
All Implemented Interfaces:
WarningsParser
Direct Known Subclasses:
AcuCobolParser, AntJavacParser, BuckminsterParser, CoolfluxChessccParser, DynamicParser, ErlcParser, FlexSDKParser, Gcc4CompilerParser, Gcc4LinkerParser, GccParser, GnatParser, IntelCParser, InvalidsParser, JavacParser, JavaDocParser, MsBuildParser, P4Parser, PhpParser, RobocopyParser, SunCParser, TiCcsParser, TnsdlParser

public abstract class RegexpLineParser
extends RegexpParser

Parses an input stream line by line for compiler warnings using the provided regular expression. Multiple line regular expressions are not supported, each warnings has to be one a single line.

Author:
Ulli Hafner

Field Summary
 
Fields inherited from class hudson.plugins.warnings.parser.RegexpParser
DEPRECATION, FALSE_POSITIVE, PROPRIETARY_API
 
Constructor Summary
RegexpLineParser(java.lang.String warningPattern, java.lang.String name)
          Creates a new instance of RegexpParser.
RegexpLineParser(java.lang.String warningPattern, java.lang.String name, boolean isStringMatchActivated)
          Creates a new instance of RegexpParser.
 
Method Summary
protected  boolean isLineInteresting(java.lang.String line)
          Returns whether the specified line is interesting.
 java.util.Collection<hudson.plugins.analysis.util.model.FileAnnotation> parse(java.io.Reader file)
          Parses the specified input stream for compiler warnings using the provided regular expression.
 
Methods inherited from class hudson.plugins.warnings.parser.RegexpParser
classifyIfEmpty, classifyWarning, createWarning, findAnnotations, getLineNumber, getName, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegexpLineParser

public RegexpLineParser(java.lang.String warningPattern,
                        java.lang.String name)
Creates a new instance of RegexpParser. Uses a single line matcher.

Parameters:
warningPattern - pattern of compiler warnings.
name - name of the parser

RegexpLineParser

public RegexpLineParser(java.lang.String warningPattern,
                        java.lang.String name,
                        boolean isStringMatchActivated)
Creates a new instance of RegexpParser. Uses a single line matcher.

Parameters:
warningPattern - pattern of compiler warnings.
name - name of the parser
isStringMatchActivated - determines if a line is checked for a string existence before the regexp is applied
Method Detail

parse

public java.util.Collection<hudson.plugins.analysis.util.model.FileAnnotation> parse(java.io.Reader file)
                                                                              throws java.io.IOException
Parses the specified input stream for compiler warnings using the provided regular expression.

Parameters:
file - the file to parse
Returns:
the collection of annotations
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

isLineInteresting

protected boolean isLineInteresting(java.lang.String line)
Returns whether the specified line is interesting. Each interesting line will be handled 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.

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.


Copyright © 2010. All Rights Reserved.