Class RegexErrorParser
- java.lang.Object
-
- org.eclipse.cdt.core.errorparsers.RegexErrorParser
-
- All Implemented Interfaces:
Cloneable,IErrorParser,IErrorParserNamed
- Direct Known Subclasses:
FixitErrorParser
public class RegexErrorParser extends Object implements IErrorParserNamed
RegexerrorParseris an error parser designed to use regular expressions in order to parse build output to produce Errors, Warnings or Infos in Problems View. Clients may extend this class. As it implementsCloneableinterface those clients must implementObject.clone()andObject.equals(java.lang.Object)methods to avoid slicing. Hint to implementers: if you want to extend it with customizedRegexErrorPatternit is possible to inject it inaddPattern(RegexErrorPattern).- Since:
- 5.2
- See Also:
IErrorParser
-
-
Constructor Summary
Constructors Constructor Description RegexErrorParser()Default constructor will initialize the error parser with the name of the class using reflection mechanism.RegexErrorParser(String id, String name)Constructor to initialize ID and name of the error parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPattern(RegexErrorPattern pattern)Add newRegexErrorPattern.voidclearPatterns()Remove all error patterns.Objectclone()booleanequals(Object o)StringgetId()StringgetName()RegexErrorPattern[]getPatterns()booleanprocessLine(String line, ErrorParserManager epManager)Parse a line of build output and register errors/warnings/infos for Problems view in internal list ofErrorParserManager.voidremovePattern(RegexErrorPattern pattern)Remove error pattern from processing.voidsetId(String id)Set error parser ID.voidsetName(String name)Set error parser name.StringtoString()Method toString() for debugging purposes.
-
-
-
Method Detail
-
setId
public void setId(String id)
Set error parser ID.- Specified by:
setIdin interfaceIErrorParserNamed- Parameters:
id- of error parser
-
setName
public void setName(String name)
Set error parser name.- Specified by:
setNamein interfaceIErrorParserNamed- Parameters:
name- of error parser
-
addPattern
public void addPattern(RegexErrorPattern pattern)
Add newRegexErrorPattern.- Parameters:
pattern- - new pattern
-
removePattern
public void removePattern(RegexErrorPattern pattern)
Remove error pattern from processing.- Parameters:
pattern- - error pattern to remove
-
clearPatterns
public void clearPatterns()
Remove all error patterns.
-
toString
public String toString()
Method toString() for debugging purposes.
-
getId
public String getId()
- Specified by:
getIdin interfaceIErrorParserNamed- Returns:
- id of error parser
-
getName
public String getName()
- Specified by:
getNamein interfaceIErrorParserNamed- Returns:
- name of error parser
-
getPatterns
public RegexErrorPattern[] getPatterns()
- Returns:
- array of error patterns of this error parser.
-
processLine
public boolean processLine(String line, ErrorParserManager epManager)
Parse a line of build output and register errors/warnings/infos for Problems view in internal list ofErrorParserManager.- Specified by:
processLinein interfaceIErrorParser- Parameters:
line- - line of the inputepManager- - error parsers manager- Returns:
- true if error parser recognized and accepted line, false otherwise
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
-