Package org.eclipse.cdt.core.errorparsers

# 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 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:
  - `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

Modifier and Type
Method
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.

### Methods inherited from class java.lang.Object

`finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### RegexErrorParser

public RegexErrorParser()
Default constructor will initialize the error parser with the name of the class using reflection mechanism.

### RegexErrorParser

public RegexErrorParser(String id, String name)
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

public void setId(String id)
Set error parser ID.

Specified by:
  `setId` in interface `IErrorParserNamed`
Parameters:
  `id` - of error parser

### setName

public void setName(String name)
Set error parser name.

Specified by:
  `setName` in interface `IErrorParserNamed`
Parameters:
  `name` - of error parser

### addPattern

public void addPattern(RegexErrorPattern pattern)
Add new `RegexErrorPattern`.

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.

Overrides:
  `toString` in class `Object`

### getId

public String getId()

Specified by:
  `getId` in interface `IErrorParserNamed`
Returns:
  id of error parser

### getName

public String getName()

Specified by:
  `getName` in interface `IErrorParserNamed`
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 of `ErrorParserManager`.

Specified by:
  `processLine` in interface `IErrorParser`
Parameters:
  `line` - - line of the input
  `epManager` - - error parsers manager
Returns:
  true if error parser recognized and accepted line, false otherwise

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### clone

public Object clone() throws CloneNotSupportedException

Overrides:
  `clone` in class `Object`
Throws:
  `CloneNotSupportedException`