Class GroovyParser
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<GroovyParser>
-
- io.jenkins.plugins.analysis.warnings.groovy.GroovyParser
-
- All Implemented Interfaces:
Describable<GroovyParser>
,Serializable
public class GroovyParser extends AbstractDescribableImpl<GroovyParser> implements Serializable
Defines the properties of a warnings parser that uses a Groovy script to parse the warnings log.- Author:
- Ullrich Hafner
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GroovyParser.DescriptorImpl
Descriptor to validateGroovyParser
.
-
Constructor Summary
Constructors Constructor Description GroovyParser(String id, String name, String regexp, String script, String example)
Creates a new instance ofGroovyParser
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description edu.hm.hafner.analysis.IssueParser
createParser()
Returns a new parser instance.boolean
equals(Object o)
String
getExample()
Returns the example to verify the parser.String
getId()
String
getName()
Returns the name.String
getRegexp()
Returns the regular expression.String
getScript()
Returns the Groovy script.int
hashCode()
boolean
hasMultiLineSupport()
Returns whether the parser can scan messages spanning multiple lines.boolean
isValid()
Validates this instance.-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Constructor Detail
-
GroovyParser
@DataBoundConstructor public GroovyParser(String id, String name, String regexp, String script, String example)
Creates a new instance ofGroovyParser
.- Parameters:
id
- the ID of the parsername
- the name of the parserregexp
- the regular expressionscript
- the script to map the expression to a warningexample
- the example to verify the parser
-
-
Method Detail
-
isValid
public boolean isValid()
Validates this instance.- Returns:
true
if this instance is valid,false
otherwise
-
getId
public String getId()
-
getName
public String getName()
Returns the name.- Returns:
- the name
-
getRegexp
public String getRegexp()
Returns the regular expression.- Returns:
- the regular expression
-
getScript
public String getScript()
Returns the Groovy script.- Returns:
- the Groovy script
-
getExample
public String getExample()
Returns the example to verify the parser.- Returns:
- the example
-
hasMultiLineSupport
public final boolean hasMultiLineSupport()
Returns whether the parser can scan messages spanning multiple lines.- Returns:
true
if the parser can scan messages spanning multiple lines
-
createParser
public edu.hm.hafner.analysis.IssueParser createParser()
Returns a new parser instance.- Returns:
- a new parser instance
- Throws:
IllegalArgumentException
- if this parsers configuration is not valid
-
-