Class RegexErrorParser
java.lang.Object
org.eclipse.cdt.core.errorparsers.RegexErrorParser
- All Implemented Interfaces:
Cloneable
,IErrorParser
,IErrorParserNamed
- Direct Known Subclasses:
FixitErrorParser
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 implements Cloneable
interface those clients
must implement Object.clone()
and Object.equals(java.lang.Object)
methods to avoid slicing.
Hint to implementers: if you want to extend it with customized RegexErrorPattern
it is possible to inject it in addPattern(RegexErrorPattern)
.- Since:
- 5.2
- See Also:
-
Constructor Summary
ConstructorDescriptionDefault 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
Modifier and TypeMethodDescriptionvoid
addPattern
(RegexErrorPattern pattern) Add newRegexErrorPattern
.void
Remove all error patterns.clone()
boolean
getId()
getName()
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
Set error parser ID.void
Set error parser name.toString()
Method toString() for debugging purposes.
-
Constructor Details
-
RegexErrorParser
public RegexErrorParser()Default constructor will initialize the error parser with the name of the class using reflection mechanism. -
RegexErrorParser
Constructor to initialize ID and name of the error parser.- Parameters:
id
- - ID of the error parser.name
- - name of the error parser.
-
-
Method Details
-
setId
Set error parser ID.- Specified by:
setId
in interfaceIErrorParserNamed
- Parameters:
id
- of error parser
-
setName
Set error parser name.- Specified by:
setName
in interfaceIErrorParserNamed
- Parameters:
name
- of error parser
-
addPattern
Add newRegexErrorPattern
.- Parameters:
pattern
- - new pattern
-
removePattern
Remove error pattern from processing.- Parameters:
pattern
- - error pattern to remove
-
clearPatterns
public void clearPatterns()Remove all error patterns. -
toString
Method toString() for debugging purposes. -
getId
- Specified by:
getId
in interfaceIErrorParserNamed
- Returns:
- id of error parser
-
getName
- Specified by:
getName
in interfaceIErrorParserNamed
- Returns:
- name of error parser
-
getPatterns
- Returns:
- array of error patterns of this error parser.
-
processLine
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
-
equals
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-