Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
[FIXED JENKINS-9535] Persist example message of dynamic parsers.
  • Loading branch information
uhafner committed Jun 15, 2011
1 parent 9f8762b commit 97af2fb8187a083b2ddb620b2b210d064ccd2853
Showing with 30 additions and 1 deletion.
  1. +30 −1 src/main/java/hudson/plugins/warnings/GroovyParser.java
@@ -20,6 +20,8 @@ public class GroovyParser {
private final String name;
private final String regexp;
private final String script;
/** @since 3.18. */
private final String example;

/**
* Creates a new instance of {@link GroovyParser}.
@@ -30,12 +32,29 @@ public class GroovyParser {
* the regular expression
* @param script
* the script to map the expression to a warning
* @param example
* the example to verify the parser
*/
@DataBoundConstructor
public GroovyParser(final String name, final String regexp, final String script) {
public GroovyParser(final String name, final String regexp, final String script, final String example) {
this.name = name;
this.regexp = regexp;
this.script = script;
this.example = example;
}

/**
* Creates a new instance of {@link GroovyParser}.
*
* @param name
* the name of the parser
* @param regexp
* the regular expression
* @param script
* the script to map the expression to a warning
*/
public GroovyParser(final String name, final String regexp, final String script) {
this(name, regexp, script, StringUtils.EMPTY);
}

/**
@@ -77,6 +96,16 @@ public String getScript() {
return script;
}

/**
* Returns the example to verify the parser.
*
* @return the example
* @since 3.18
*/
public String getExample() {
return StringUtils.defaultString(example);
}

/**
* Returns whether the parser can scan messages spanning multiple lines.
*

0 comments on commit 97af2fb

Please sign in to comment.