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
RegexerrorParser
is 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 implementsCloneable
interface those clients must implementObject.clone()
andObject.equals(java.lang.Object)
methods to avoid slicing. Hint to implementers: if you want to extend it with customizedRegexErrorPattern
it 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 void
addPattern(RegexErrorPattern pattern)
Add newRegexErrorPattern
.void
clearPatterns()
Remove all error patterns.Object
clone()
boolean
equals(Object o)
String
getId()
String
getName()
RegexErrorPattern[]
getPatterns()
boolean
processLine(String line, ErrorParserManager epManager)
Parse a line of build output and register errors/warnings/infos for Problems view in internal list ofErrorParserManager
.void
removePattern(RegexErrorPattern pattern)
Remove error pattern from processing.void
setId(String id)
Set error parser ID.void
setName(String name)
Set error parser name.String
toString()
Method toString() for debugging purposes.
-
-
-
Method Detail
-
setId
public void setId(String id)
Set error parser ID.- Specified by:
setId
in interfaceIErrorParserNamed
- Parameters:
id
- of error parser
-
setName
public void setName(String name)
Set error parser name.- Specified by:
setName
in 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:
getId
in interfaceIErrorParserNamed
- Returns:
- id of error parser
-
getName
public String getName()
- Specified by:
getName
in 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:
processLine
in 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:
clone
in classObject
- Throws:
CloneNotSupportedException
-
-