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 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)
.IErrorParser
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
void |
addPattern(RegexErrorPattern pattern)
Add new
RegexErrorPattern . |
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 of
ErrorParserManager . |
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.
|
public RegexErrorParser()
public void setId(String id)
setId
in interface IErrorParserNamed
id
- of error parserpublic void setName(String name)
setName
in interface IErrorParserNamed
name
- of error parserpublic void addPattern(RegexErrorPattern pattern)
RegexErrorPattern
.pattern
- - new patternpublic void removePattern(RegexErrorPattern pattern)
pattern
- - error pattern to removepublic void clearPatterns()
public String toString()
public String getId()
getId
in interface IErrorParserNamed
public String getName()
getName
in interface IErrorParserNamed
public RegexErrorPattern[] getPatterns()
public boolean processLine(String line, ErrorParserManager epManager)
ErrorParserManager
.processLine
in interface IErrorParser
line
- - line of the inputepManager
- - error parsers managerpublic Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.